pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

plink2: Fix build on NetBSD 7.1



Module Name:	pkgsrc-wip
Committed By:	Jason Bacon <bacon%NetBSD.org@localhost>
Pushed By:	outpaddling
Date:		Wed May 23 14:08:04 2018 -0500
Changeset:	6214737a3d78961b17d176138eb838b81b90a5e4

Modified Files:
	plink2/Makefile
	plink2/distinfo
	plink2/patches/patch-plink2__base.h
Added Files:
	plink2/files/Makefile.generic
Removed Files:
	plink2/patches/patch-Makefile

Log Message:
plink2: Fix build on NetBSD 7.1

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=6214737a3d78961b17d176138eb838b81b90a5e4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 plink2/Makefile                     |  4 +--
 plink2/distinfo                     |  3 +-
 plink2/files/Makefile.generic       | 59 +++++++++++++++++++++++++++++++++++++
 plink2/patches/patch-Makefile       | 31 -------------------
 plink2/patches/patch-plink2__base.h |  2 +-
 5 files changed, 62 insertions(+), 37 deletions(-)

diffs:
diff --git a/plink2/Makefile b/plink2/Makefile
index 67f4aca6c6..709026ec9a 100644
--- a/plink2/Makefile
+++ b/plink2/Makefile
@@ -14,7 +14,6 @@ GITHUB_TAG=	f758bbd77e04eb0cb46fbc633be60b22b8b3cc2d
 MAINTAINER=	bacon%NetBSD.org@localhost
 HOMEPAGE=	http://pngu.mgh.harvard.edu/~purcell/plink/
 COMMENT=	Whole genome association analysis toolset
-# Check this
 LICENSE=	gnu-gpl-v2
 
 USE_LANGUAGES=	c c++ fortran
@@ -25,7 +24,6 @@ WRKSRC=		${WRKDIR}/${GITHUB_PROJECT}-${GITHUB_TAG}/2.0
 CFLAGS+=	-g -DDYNAMIC_ZLIB -I${PREFIX}/include
 CXXFLAGS+=	-g -DDYNAMIC_ZLIB -I${PREFIX}/include
 
-# Check this
 # MAKE_FLAGS+=	ZLIB=-lz BLASFLAGS64="-L${PREFIX}/lib -lopenblas"
 MAKE_FLAGS+=	ZLIB=-lz BLASFLAGS64="-L${PREFIX}/lib -llapack -lcblas -lblas"
 # Keep debug info until at least next beta
@@ -34,7 +32,7 @@ MAKE_FLAGS+=	ZLIB=-lz BLASFLAGS64="-L${PREFIX}/lib -llapack -lcblas -lblas"
 PORTVERSION=	0.0.0.20180518
 USE_BUILTIN.zlib=	no
 
-.include "options.mk"
+MAKE_FILE=	${FILESDIR}/Makefile.generic
 
 # .include "../../wip/openblas/buildlink3.mk"
 .include "../../math/blas/buildlink3.mk"
diff --git a/plink2/distinfo b/plink2/distinfo
index cf3c71a929..a8bb5ef566 100644
--- a/plink2/distinfo
+++ b/plink2/distinfo
@@ -4,5 +4,4 @@ SHA1 (plink-ng-0.0.0.20180518-f758bbd77e04eb0cb46fbc633be60b22b8b3cc2d.tar.gz) =
 RMD160 (plink-ng-0.0.0.20180518-f758bbd77e04eb0cb46fbc633be60b22b8b3cc2d.tar.gz) = 7be21109553e1a984f96e19887b5179bd6e94937
 SHA512 (plink-ng-0.0.0.20180518-f758bbd77e04eb0cb46fbc633be60b22b8b3cc2d.tar.gz) = 412f3b27b509fd731f816739a8155c77d407af6761749ce9b3eaabfa0e701426134c1bf4862101c379bbf63f97b425726b49283aa0dd96d74976c56e03a15426
 Size (plink-ng-0.0.0.20180518-f758bbd77e04eb0cb46fbc633be60b22b8b3cc2d.tar.gz) = 2392148 bytes
-SHA1 (patch-Makefile) = 7c87e9c912ba4ae175663942768c6ba811bef177
-SHA1 (patch-plink2__base.h) = 08cc1710f2824985dc132149ca102f82e0488bf1
+SHA1 (patch-plink2__base.h) = 4a662fa7abd55069a5c85d5381fcab6a5c1ca7d2
diff --git a/plink2/files/Makefile.generic b/plink2/files/Makefile.generic
new file mode 100644
index 0000000000..33bfc353f0
--- /dev/null
+++ b/plink2/files/Makefile.generic
@@ -0,0 +1,59 @@
+
+BASEFLAGS=-DNDEBUG -DZSTD_MULTITHREAD
+
+include Makefile.src
+
+# Respect the environment:
+# Use defaults below only if not set in env or make arguments
+CC		?= gcc
+CXX		?= g++
+CFLAGS		?= -O2
+CXXFLAGS	?= -O2
+ZLIB		?= ../zlib-1.2.11/libz-64.a
+BLASFLAGS	?= -llapack -lf77blas -latlas
+ARCH32		?=
+
+# Mandatory flags added to defaults or env settings
+CFLAGS		+= -std=gnu99 $(BASEFLAGS) $(CWARN2) $(CINCLUDE) $(ZSTD_INCLUDE)
+CXXFLAGS	+= -std=c++1y $(BASEFLAGS) $(CXXWARN2)
+LDFLAGS		+= -lm -lpthread -L. $(ZLIB)
+
+# Installation defaults
+MKDIR		?= mkdir
+INSTALL		?= install
+STRIP_CMD	?= strip
+PREFIX		?= /usr/local
+DESTDIR		?= .
+
+%.o: %.c
+	$(CC) -c $(CFLAGS) $(ARCH32) -o $@ $<
+
+%.o: %.cc
+	$(CXX) -c $(CXXFLAGS) $(ARCH32) -o $@ $<
+
+all: plink2 pgen_compress
+
+# for clean build, "make clean" first
+# Run mkdir for both plink2 and pgen_compress as we don't know which
+# target will run first
+plink2: $(OBJ)
+	$(MKDIR) -p bin
+	$(CXX) $(ARCH32) $(OBJ) -o bin/plink2 $(BLASFLAGS64) $(LDFLAGS)
+
+# basic pgenlib_internal.h usage example; also needed for tests
+pgen_compress: plink2_base.o pgenlib_internal.o pgen_compress.o
+	$(MKDIR) -p bin
+	$(CXX) plink2_base.o pgenlib_internal.o pgen_compress.o \
+		-o bin/pgen_compress $(BLASFLAGS64) $(LDFLAGS)
+
+.PHONY: install-strip install clean
+
+install-strip: install
+	$(STRIP_CMD) $(DESTDIR)$(PREFIX)/bin/*
+
+install: all
+	$(MKDIR) -p $(DESTDIR)$(PREFIX)/bin
+	$(INSTALL) -c bin/* $(DESTDIR)$(PREFIX)/bin
+
+clean:
+	rm -f $(CLEAN)
diff --git a/plink2/patches/patch-Makefile b/plink2/patches/patch-Makefile
deleted file mode 100644
index 982622d1c7..0000000000
--- a/plink2/patches/patch-Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD$
-
-# Remove non-portable CPU features
-
---- Makefile.orig	2018-05-20 12:46:52.707854971 +0000
-+++ Makefile
-@@ -1,12 +1,13 @@
- 
- ###########################################################################
- # Note: This Makefile is intended for development.  For production
--# builds, use build_dynamic/Makefile.
-+# builds, use build_dynamic/Makefile or edit out assumptions such as
-+# -mavx2.
- ###########################################################################
- 
- # Does not currently support -DCPU_CHECK_...
- 
--BASEFLAGS=-g -mavx2 -mbmi -mbmi2 -mlzcnt -DZSTD_MULTITHREAD
-+BASEFLAGS=-DNDEBUG -DZSTD_MULTITHREAD
- # BASEFLAGS=-g -mavx2 -mbmi -mbmi2 -mlzcnt -DZSTD_MULTITHREAD
- # BASEFLAGS=-g -msse4.2 -DZSTD_MULTITHREAD
- 
-@@ -23,7 +24,7 @@ BLASFLAGS64	?= -llapack -lf77blas -latla
- ARCH32		?=
- 
- # Mandatory flags added to defaults or env settings
--CFLAGS		+= -std=gnu99 $(BASEFLAGS) $(CWARN) $(CINCLUDE) $(ZSTD_INCLUDE)
-+CFLAGS		+= -std=gnu99 $(BASEFLAGS) $(CWARN2) $(CINCLUDE) $(ZSTD_INCLUDE)
- CXXFLAGS	+= -std=c++14 $(BASEFLAGS) $(CXXWARN)
- LDFLAGS		+= -lm -lpthread -L. $(ZLIB)
- 
diff --git a/plink2/patches/patch-plink2__base.h b/plink2/patches/patch-plink2__base.h
index 87e3f7420f..a540d9c4aa 100644
--- a/plink2/patches/patch-plink2__base.h
+++ b/plink2/patches/patch-plink2__base.h
@@ -9,7 +9,7 @@ $NetBSD$
  #  define FOPEN_WB "w"
  #  define FOPEN_AB "a"
 -#  ifdef __APPLE__
-+#  if defined(__APPLE__) || defined(__FreeBSD__)
++#  if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
 +#    define fread_unlocked fread
 +#    define fwrite_unlocked fwrite
 +#  endif


Home | Main Index | Thread Index | Old Index