diff options
author | Alastair Pharo | 2019-11-22 00:40:15 +1100 |
---|---|---|
committer | Alastair Pharo | 2019-11-22 00:40:15 +1100 |
commit | 11138caadf06e3f07d6a385a3e9ce6cd7d00c89d (patch) | |
tree | 5d0257fb2d5b2f06df03e7c71cbcb98ca6c564ec | |
parent | 85d7e5b9f8789052cca8812d97cb37f8d635166e (diff) | |
download | aur-11138caadf06e3f07d6a385a3e9ce6cd7d00c89d.tar.gz |
Add linking patch
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 11 | ||||
-rw-r--r-- | ldflags.patch | 24 |
3 files changed, 34 insertions, 5 deletions
@@ -1,7 +1,7 @@ pkgbase = nix pkgdesc = A purely functional package manager pkgver = 2.3.1 - pkgrel = 1 + pkgrel = 2 url = https://nixos.org/nix install = nix.install arch = i686 @@ -17,7 +17,9 @@ pkgbase = nix depends = editline optdepends = archlinux-nix: tools to help with setup of Nix source = https://nixos.org/releases/nix/nix-2.3.1/nix-2.3.1.tar.xz + source = ldflags.patch sha256sums = bb6578e9f20eebab6d78469ecc59c450ac54f276e5a86a882015d98fecb1bc7b + sha256sums = 42350237d98785b30b0ee099405f2f1f7412f8a816162c22bd232ed3dbbe0305 pkgname = nix @@ -8,7 +8,7 @@ pkgname=nix pkgver=2.3.1 -pkgrel=1 +pkgrel=2 pkgdesc="A purely functional package manager" arch=('i686' 'x86_64' 'armv7h') url="https://nixos.org/nix" @@ -17,16 +17,19 @@ depends=('gc' 'libsodium' 'boost' 'brotli' 'editline') optdepends=('archlinux-nix: tools to help with setup of Nix') makedepends=('bzip2' 'openssl') install=nix.install -source=("https://nixos.org/releases/nix/nix-$pkgver/nix-$pkgver.tar.xz") -sha256sums=('bb6578e9f20eebab6d78469ecc59c450ac54f276e5a86a882015d98fecb1bc7b') +source=("https://nixos.org/releases/nix/nix-$pkgver/nix-$pkgver.tar.xz" + 'ldflags.patch') +sha256sums=('bb6578e9f20eebab6d78469ecc59c450ac54f276e5a86a882015d98fecb1bc7b' + '42350237d98785b30b0ee099405f2f1f7412f8a816162c22bd232ed3dbbe0305') prepare() { cd "$pkgname-$pkgver" + patch --forward --strip=1 --input="${srcdir}/ldflags.patch" } build () { cd "$pkgname-$pkgver" - ./configure --prefix=/usr \ + CXXFLAGS='-D_GLIBCXX_USE_CXX11_ABI=0' ./configure --prefix=/usr \ --libexecdir="/usr/lib/$pkgname" \ --sysconfdir=/etc \ --enable-gc diff --git a/ldflags.patch b/ldflags.patch new file mode 100644 index 000000000000..1a2c4e16703b --- /dev/null +++ b/ldflags.patch @@ -0,0 +1,24 @@ +diff --git a/mk/libraries.mk b/mk/libraries.mk +index 307e29b9d05..25cb1b81da6 100644 +--- a/mk/libraries.mk ++++ b/mk/libraries.mk +@@ -96,7 +96,9 @@ define build-library + ifneq ($(OS), Darwin) + $(1)_LDFLAGS_USE += -Wl,-rpath,$$(abspath $$(_d)) + endif +- $(1)_LDFLAGS_USE += -L$$(_d) -l$$(patsubst lib%,%,$$(strip $$($(1)_NAME))) ++ # -L and -l might conflict with previously-installed libraries. Instead ++ # pass the file directly to the linker. ++ $(1)_LDFLAGS_USE += -Wl,$$(_d)/$$($(1)_NAME).$(SO_EXT) + + $(1)_INSTALL_PATH := $(DESTDIR)$$($(1)_INSTALL_DIR)/$$($(1)_NAME).$(SO_EXT) + +@@ -107,7 +109,7 @@ define build-library + $$($(1)_INSTALL_PATH): $$($(1)_OBJS) $$(_libs_final) | $(DESTDIR)$$($(1)_INSTALL_DIR)/ + $$(trace-ld) $(CXX) -o $$@ -shared $$(LDFLAGS) $$(GLOBAL_LDFLAGS) $$($(1)_OBJS) $$($(1)_LDFLAGS) $$($(1)_LDFLAGS_PROPAGATED) $$(foreach lib, $$($(1)_LIBS), $$($$(lib)_LDFLAGS_USE_INSTALLED)) + +- $(1)_LDFLAGS_USE_INSTALLED += -L$$(DESTDIR)$$($(1)_INSTALL_DIR) -l$$(patsubst lib%,%,$$(strip $$($(1)_NAME))) ++ $(1)_LDFLAGS_USE_INSTALLED += -Wl,$$(DESTDIR)$$($(1)_INSTALL_DIR)/$$($(1)_NAME).$(SO_EXT) + ifneq ($(OS), Darwin) + ifeq ($(SET_RPATH_TO_LIBS), 1) + $(1)_LDFLAGS_USE_INSTALLED += -Wl,-rpath,$$($(1)_INSTALL_DIR) |