lowdown: fix cygwin build
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 8877a17..f73fe5f 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -161,7 +161,7 @@ MAIN_OBJS = $(COMPAT_OBJS)
|
||||
|
||||
# Mac OS X and other Unix systems use different conventions for
|
||||
# indicating shared library versions.
|
||||
-.if $(LINKER_SOSUFFIX) == "dylib"
|
||||
+.if $(LINKER_SOSUFFIX) == "dylib" || $(LINKER_SOSUFFIX) == "dll"
|
||||
LIB_SOVER = liblowdown.$(LIBVER).$(LINKER_SOSUFFIX)
|
||||
.else
|
||||
LIB_SOVER = liblowdown.$(LINKER_SOSUFFIX).$(LIBVER)
|
||||
@@ -190,7 +190,7 @@ REGRESS_ARGS += "--parse-no-deflists"
|
||||
REGRESS_ENV = LC_ALL=en_US.UTF-8
|
||||
|
||||
all: bins lowdown.pc $(LIB_SO)
|
||||
-bins: lowdown lowdown-diff
|
||||
+bins: lowdown$(EXESUFFIX) lowdown-diff
|
||||
|
||||
www: all $(HTMLS) $(PDFS) $(THUMBS) lowdown.tar.gz lowdown.tar.gz.sha512
|
||||
|
||||
@@ -202,11 +202,11 @@ installwww: www
|
||||
$(INSTALL) -m 0444 lowdown.tar.gz $(WWWDIR)/snapshots
|
||||
$(INSTALL) -m 0444 lowdown.tar.gz.sha512 $(WWWDIR)/snapshots
|
||||
|
||||
-lowdown: $(LIB_LOWDOWN) $(MAIN_OBJS) main.o
|
||||
+lowdown$(EXESUFFIX): $(LIB_LOWDOWN) $(MAIN_OBJS) main.o
|
||||
$(CC) -o $@ main.o $(MAIN_OBJS) $(LIB_LOWDOWN) $(LDFLAGS) $(LDADD_MD5) -lm $(LDADD)
|
||||
|
||||
-lowdown-diff: lowdown
|
||||
- ln -f lowdown lowdown-diff
|
||||
+lowdown-diff: lowdown$(EXESUFFIX)
|
||||
+ ln -f lowdown$(EXESUFFIX) lowdown-diff
|
||||
|
||||
$(LIB_ST): $(OBJS) $(COMPAT_OBJS)
|
||||
$(AR) rs $@ $(OBJS) $(COMPAT_OBJS)
|
||||
@@ -240,7 +240,7 @@ install: bins
|
||||
$(INSTALL_DATA) share/man/* $(DESTDIR)$(SHAREDIR)/lowdown/man
|
||||
$(INSTALL_DATA) share/ms/* $(DESTDIR)$(SHAREDIR)/lowdown/ms
|
||||
$(INSTALL_DATA) share/odt/* $(DESTDIR)$(SHAREDIR)/lowdown/odt
|
||||
- $(INSTALL_PROGRAM) lowdown $(DESTDIR)$(BINDIR)
|
||||
+ $(INSTALL_PROGRAM) lowdown$(EXESUFFIX) $(DESTDIR)$(BINDIR)
|
||||
$(INSTALL_PROGRAM) lowdown-diff $(DESTDIR)$(BINDIR)
|
||||
for f in $(MAN1S) $(MAN5S) ; do \
|
||||
name=`basename $$f .html` ; \
|
||||
@@ -273,7 +273,7 @@ uninstall_shared: uninstall_lib_common
|
||||
rm -f $(LIBDIR)/$(LIB_SOVER) $(LIBDIR)/$(LIB_SO)
|
||||
|
||||
install_shared: $(LIB_SO) install_lib_common
|
||||
- $(INSTALL_LIB) $(LIB_SOVER) $(DESTDIR)$(LIBDIR)
|
||||
+ $(INSTALL_LIB) $(LIB_SOVER) $(IMPLIB) $(DESTDIR)$(LIBDIR)
|
||||
( cd $(DESTDIR)$(LIBDIR) && ln -sf $(LIB_SOVER) $(LIB_SO) )
|
||||
|
||||
uninstall_static: uninstall_lib_common
|
||||
@@ -406,7 +406,7 @@ main.o: lowdown.h
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) $(COMPAT_OBJS) main.o
|
||||
- rm -f lowdown lowdown-diff lowdown.pc
|
||||
+ rm -f lowdown$(EXESUFFIX) lowdown-diff lowdown.pc
|
||||
rm -f $(LIB_ST) $(LIB_SO) $(LIB_SOVER)
|
||||
rm -f index.xml diff.xml diff.diff.xml README.xml lowdown.tar.gz.sha512 lowdown.tar.gz
|
||||
rm -f $(PDFS) $(HTMLS) $(THUMBS)
|
||||
@@ -32,6 +32,9 @@ stdenv.mkDerivation rec {
|
||||
sha512 = "649a508b7727df6e7e1203abb3853e05f167b64832fd5e1271f142ccf782e600b1de73c72dc02673d7b175effdc54f2c0f60318208a968af9f9763d09cf4f9ef";
|
||||
};
|
||||
|
||||
# https://github.com/kristapsdz/lowdown/pull/171
|
||||
patches = [ ./fix-cygwin-build.patch ];
|
||||
|
||||
nativeBuildInputs = [
|
||||
which
|
||||
dieHook
|
||||
@@ -60,6 +63,7 @@ stdenv.mkDerivation rec {
|
||||
runHook postConfigure
|
||||
'';
|
||||
|
||||
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isCygwin "-D_GNU_SOURCE";
|
||||
# Fix rpath change on darwin to avoid failure like:
|
||||
# error: install_name_tool: changing install names or
|
||||
# rpaths can't be redone for: liblowdown.1.dylib (for architecture
|
||||
@@ -69,6 +73,13 @@ stdenv.mkDerivation rec {
|
||||
|
||||
makeFlags = [
|
||||
"bins" # prevents shared object from being built unnecessarily
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isCygwin [
|
||||
"EXESUFFIX=.exe"
|
||||
"LINKER_SOSUFFIX=dll"
|
||||
"LIB_SO=cyglowdown.dll"
|
||||
"IMPLIB=liblowdown.dll.a"
|
||||
"LDFLAGS=-Wl,--out-implib,liblowdown.dll.a"
|
||||
];
|
||||
|
||||
installTargets = [
|
||||
|
||||
Reference in New Issue
Block a user