diff options
author | gammy | 2019-05-19 12:41:25 +0200 |
---|---|---|
committer | gammy | 2019-05-19 12:41:25 +0200 |
commit | 85baa93aa5543c4f435edc4f532f0eb2db95bab7 (patch) | |
tree | ec3907e33c87dbdc60380446441be142f1e3683f | |
parent | a0580eb87e5f5cd2e3a8ae41bbb382ffb2a15982 (diff) | |
download | aur-85baa93aa5543c4f435edc4f532f0eb2db95bab7.tar.gz |
Create fix_libcd64_libieee1284.diff which amends a linking error if libieee1284 *is* installed already. Add libieee1284 as an optional dependency. Turn Paula Breton's CFLAGS Makefile hack into a proper patchfile. Minor adjustments to build file.
-rw-r--r-- | .SRCINFO | 5 | ||||
-rw-r--r-- | PKGBUILD | 30 | ||||
-rw-r--r-- | fix_libcd64_libieee1284.diff | 54 | ||||
-rw-r--r-- | fix_makefile_cflags.diff | 52 |
4 files changed, 126 insertions, 15 deletions
@@ -8,8 +8,13 @@ pkgbase = ucon64 license = GPL depends = zlib depends = libusb-compat + optdepends = libieee1284: libcd64 enhancements source = https://downloads.sourceforge.net/ucon64/ucon64-2.1.0-src.tar.gz + source = fix_makefile_cflags.diff + source = fix_libcd64_libieee1284.diff sha256sums = c99964060a5337cea811b27c4103e186a14ba1f04b19cff08bac0260271bc872 + sha256sums = 8f1532c4c35b98af34b3c1dc3bdeaa6c2183c7927be69ce396895491d7e8feff + sha256sums = 19efc5d87c07c11797fba657f25619c70fa175d100688eafd1094d14baad1255 pkgname = ucon64 @@ -1,4 +1,5 @@ # Maintainer: Kristian Gunstone <kristian.gunstone.butnotthispart@pean.northis.org> +# Contributor: Hugo Arpin ("harpin") # Contributor: Paula Breton <paula@parashep.com> # Contributor: robb_force <robb_force@holybuffalo.net> @@ -10,30 +11,29 @@ arch=('i686' 'x86_64') url="http://ucon64.sourceforge.net/index.php" license=('GPL') depends=('zlib' 'libusb-compat') +optdepends=('libieee1284: libcd64 enhancements') source=(https://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}-src.tar.gz) sha256sums=('c99964060a5337cea811b27c4103e186a14ba1f04b19cff08bac0260271bc872') +source+=(fix_makefile_cflags.diff) +sha256sums+=('8f1532c4c35b98af34b3c1dc3bdeaa6c2183c7927be69ce396895491d7e8feff') +source+=(fix_libcd64_libieee1284.diff) +sha256sums+=('19efc5d87c07c11797fba657f25619c70fa175d100688eafd1094d14baad1255') + +srcroot="${pkgname}-${pkgver}-src/" prepare() { - # This quickfix, which amends a typo in the Makefile resulting in - # misinterpreting CFLAGS, was added by the previous maintainer. - # - # Here's an example of what happens without the end quotation, with a - # CFLAGS variable containing spaces: - # - # $ CFLAGS="-O2 -ggdb3" make - # cd libdiscmage && CFLAGS=-O2 -ggdb3 LDFLAGS= make - # /bin/sh: -ggdb3: command not found - # make: *** [Makefile:243: libdiscmage/discmage.so] Error 127 - # $ - # - # - sed -i 's|$(CFLAGS0)|"$(CFLAGS0)"|g' ${pkgname}-${pkgver}-src/src/Makefile + echo "Applying Makefile CFLAGS fix" + patch -d "${srcroot}" -p1 < "../fix_makefile_cflags.diff" + + # Thanks harpin from the aur forums for pointing this bug out! + echo "Applying libcd64 ieee1284 shared library fix" + patch -d "${srcroot}" -p1 < "../fix_libcd64_libieee1284.diff" } build() { - cd ${pkgname}-${pkgver}-src/src + cd "${srcroot}/src" ./configure --prefix=/usr --with-libusb --with-libcd64 make } diff --git a/fix_libcd64_libieee1284.diff b/fix_libcd64_libieee1284.diff new file mode 100644 index 000000000000..5001593eb916 --- /dev/null +++ b/fix_libcd64_libieee1284.diff @@ -0,0 +1,54 @@ +diff -Naur ./src.old/Makefile ./src/Makefile +--- ./src.old/Makefile 2019-05-19 12:35:45.185395051 +0200 ++++ ./src/Makefile 2019-05-19 12:36:09.705081792 +0200 +@@ -95,6 +95,21 @@ + + ifdef USE_LIBCD64 + LDFLAGS+=backup/libcd64/libcd64.a ++# The following condition was added for the arch ucon64 AUR package: ++# https://aur.archlinux.org/packages/ucon64/ ++# The arch/artix 'libieee1284' package ships the library as a shared ++# library rather than a static one. As a result, libcd64 has no static ++# library to link against, and consequently ucon64 itself, when linking ++# in libcd64, needs to also link against the libieee1284 shared library. ++# See also src/backup/libcd64/Makefile ++ifndef DJGPP ++ifeq ($(shell if test -r /usr/include/ieee1284.h; then echo 1; else echo 0; fi),1) ++LDFLAGS+=-lieee1284 ++$(info Building with libieee1284 support) ++else ++$(warning Building without libieee1284 support) ++endif ++endif + endif + + ifdef USE_ZLIB +diff -Naur ./src.old/backup/libcd64/Makefile ./src/backup/libcd64/Makefile +--- ./src.old/backup/libcd64/Makefile 2019-05-19 12:35:45.185395051 +0200 ++++ ./src/backup/libcd64/Makefile 2019-05-19 12:36:20.374945478 +0200 +@@ -102,6 +102,9 @@ + ifeq ($(findstring Linux,$(OSTYPE)),Linux) + ifeq ($(shell if test -r /usr/include/ieee1284.h; then echo 1; else echo 0; fi),1) + LIBIEEE1284=1 ++$(info Building with libieee1284 support) ++else ++$(warning Building without libieee1284 support) + endif + ifeq ($(shell if test -r /usr/include/linux/ppdev.h; then echo 1; else echo 0; fi),1) + PPDEV=1 +@@ -116,7 +119,15 @@ + + ifdef LIBIEEE1284 + CFLAGS+=-DCD64_USE_LIBIEEE1284 ++# The following condition was added for the arch ucon64 AUR package: ++# https://aur.archlinux.org/packages/ucon64/ ++# The arch/artix (i.e linux) 'libieee1284' package ships the library as a ++# shared library rather than a static one, so including the static file leading ++# to a linking error. ++# DJGPP (i.e gcc for DOS) probably still expects a static library. ++ifdef DJGPP + LIBS+=/usr/lib/libieee1284.a ++endif + LDFLAGS+=-lieee1284 + endif + diff --git a/fix_makefile_cflags.diff b/fix_makefile_cflags.diff new file mode 100644 index 000000000000..185c72bb6261 --- /dev/null +++ b/fix_makefile_cflags.diff @@ -0,0 +1,52 @@ +--- ./src/Makefile.old 2019-05-19 11:02:52.666559482 +0200 ++++ ./src/Makefile 2019-05-19 11:09:34.651427078 +0200 +@@ -227,20 +227,26 @@ + $(CC) $(CFLAGS) -Ibackup/libcd64 -c $< -o $@ + + ++# The following lines which make use of and quote $(CFLAGS0) have been patched ++# by the arch ucon64 AUR package: https://aur.archlinux.org/packages/ucon64/ ++# It resolves an issue where the build will fail if a user supplies a custom ++# CFLAGS argument which contains multiple parameters, e.g ++# $ CFLAGS="-O2 -ggdb3" make ++# which doesn't impede the normal build process, but makes debugging a pain. + ifdef USE_DISCMAGE + .PHONY: libdiscmage/$(FULLLIBNAME_DM) + libdiscmage/$(FULLLIBNAME_DM): + ifeq ($(GCC_WIN),1) +- cd libdiscmage && CFLAGS=$(CFLAGS0) LDFLAGS=$(LDFLAGS0) $(MAKE) ++ cd libdiscmage && CFLAGS="$(CFLAGS0)" LDFLAGS=$(LDFLAGS0) $(MAKE) + else + ifdef DJGPP + cd libdiscmage +- set CFLAGS=$(CFLAGS0) ++ set CFLAGS="$(CFLAGS0)" + set LDFLAGS=$(LDFLAGS0) + $(MAKE) + cd .. + else +- cd libdiscmage && CFLAGS=$(CFLAGS0) LDFLAGS=$(LDFLAGS0) $(MAKE) ++ cd libdiscmage && CFLAGS="$(CFLAGS0)" LDFLAGS=$(LDFLAGS0) $(MAKE) + endif # DJGPP + endif # GCC_WIN + endif # USE_DISCMAGE +@@ -250,16 +256,16 @@ + #.PHONY: backup/libcd64/libcd64.a Do not force linking an executable. + backup/libcd64/libcd64.a: + ifeq ($(GCC_WIN),1) +- cd backup/libcd64 && CFLAGS=$(CFLAGS0) LDFLAGS=$(LDFLAGS0) $(MAKE) ++ cd backup/libcd64 && CFLAGS="$(CFLAGS0)" LDFLAGS=$(LDFLAGS0) $(MAKE) + else + ifdef DJGPP + cd backup/libcd64 +- set CFLAGS=$(CFLAGS0) ++ set CFLAGS="$(CFLAGS0)" + set LDFLAGS=$(LDFLAGS0) + $(MAKE) + cd ../.. + else +- cd backup/libcd64 && CFLAGS=$(CFLAGS0) LDFLAGS=$(LDFLAGS0) $(MAKE) ++ cd backup/libcd64 && CFLAGS="$(CFLAGS0)" LDFLAGS=$(LDFLAGS0) $(MAKE) + endif # DJGPP + endif # GCC_WIN + endif # USE_LIBCD64 |