1
0
mirror of https://github.com/bertptrs/aur.git synced 2025-12-25 20:40:32 +01:00

Add linking patch

This commit is contained in:
Alastair Pharo
2019-11-22 00:40:15 +11:00
parent 85d7e5b9f8
commit 11138caadf
3 changed files with 34 additions and 5 deletions

View File

@@ -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

View File

@@ -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

24
ldflags.patch Normal file
View File

@@ -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)