From f64de9a8da7300faa6e6fb448d57441716b93acf Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Sat, 6 Mar 2021 10:08:39 +0100 Subject: [PATCH] git subrepo clone --branch=master https://aur.archlinux.org/nix subrepo: subdir: "nix" merged: "d332da3" upstream: origin: "https://aur.archlinux.org/nix" branch: "master" commit: "d332da3" git-subrepo: version: "0.4.3" origin: "???" commit: "???" --- nix/.SRCINFO | 25 +++++++++++++++++++++++++ nix/.gitrepo | 12 ++++++++++++ nix/PKGBUILD | 43 +++++++++++++++++++++++++++++++++++++++++++ nix/ldflags.patch | 24 ++++++++++++++++++++++++ nix/nix.install | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 136 insertions(+) create mode 100644 nix/.SRCINFO create mode 100644 nix/.gitrepo create mode 100644 nix/PKGBUILD create mode 100644 nix/ldflags.patch create mode 100644 nix/nix.install diff --git a/nix/.SRCINFO b/nix/.SRCINFO new file mode 100644 index 0000000..0efa6ab --- /dev/null +++ b/nix/.SRCINFO @@ -0,0 +1,25 @@ +pkgbase = nix + pkgdesc = A purely functional package manager + pkgver = 2.3.10 + pkgrel = 1 + url = https://nixos.org/nix + install = nix.install + arch = i686 + arch = x86_64 + arch = armv7h + license = LGPL + makedepends = bzip2 + makedepends = openssl + depends = gc + depends = libsodium + depends = boost + depends = brotli + depends = editline + optdepends = archlinux-nix: tools to help with setup of Nix + source = https://nixos.org/releases/nix/nix-2.3.10/nix-2.3.10.tar.xz + source = ldflags.patch + sha256sums = a8a85e55de43d017abbf13036edfb58674ca136691582f17080c1cd12787b7ab + sha256sums = 42350237d98785b30b0ee099405f2f1f7412f8a816162c22bd232ed3dbbe0305 + +pkgname = nix + diff --git a/nix/.gitrepo b/nix/.gitrepo new file mode 100644 index 0000000..aadee7a --- /dev/null +++ b/nix/.gitrepo @@ -0,0 +1,12 @@ +; DO NOT EDIT (unless you know what you are doing) +; +; This subdirectory is a git "subrepo", and this file is maintained by the +; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme +; +[subrepo] + remote = https://aur.archlinux.org/nix + branch = master + commit = d332da353c20df8ed1af7f7f1e2dea8bbe57fc56 + parent = 53649416f858999a3daf7eacd299a6c318de3ed7 + method = merge + cmdver = 0.4.3 diff --git a/nix/PKGBUILD b/nix/PKGBUILD new file mode 100644 index 0000000..0a36546 --- /dev/null +++ b/nix/PKGBUILD @@ -0,0 +1,43 @@ +# Maintainer: Alastair Pharo +# Contributor: Felix Morgner +# Contributor: Vlad M. +# Contributor: Mario Rodas +# Contributor: Oozyslug +# Contributor: koral +# Contributor: Anders Bennehag + +pkgname=nix +pkgver=2.3.10 +pkgrel=1 +pkgdesc="A purely functional package manager" +arch=('i686' 'x86_64' 'armv7h') +url="https://nixos.org/nix" +license=('LGPL') +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" + 'ldflags.patch') +sha256sums=('a8a85e55de43d017abbf13036edfb58674ca136691582f17080c1cd12787b7ab' + '42350237d98785b30b0ee099405f2f1f7412f8a816162c22bd232ed3dbbe0305') + +prepare() { + cd "$pkgname-$pkgver" + patch --forward --strip=1 --input="${srcdir}/ldflags.patch" +} + +build () { + cd "$pkgname-$pkgver" + CXXFLAGS='-D_GLIBCXX_USE_CXX11_ABI=0' ./configure --prefix=/usr \ + --libexecdir="/usr/lib/$pkgname" \ + --sysconfdir=/etc \ + --enable-gc + make +} + +package() { + cd "$pkgname-$pkgver" + make DESTDIR="$pkgdir" install + install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} diff --git a/nix/ldflags.patch b/nix/ldflags.patch new file mode 100644 index 0000000..1a2c4e1 --- /dev/null +++ b/nix/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) diff --git a/nix/nix.install b/nix/nix.install new file mode 100644 index 0000000..e07213e --- /dev/null +++ b/nix/nix.install @@ -0,0 +1,32 @@ +install_info() { + echo "Nix is installed but no configuration has been done to make it work." + echo "You may wish to install the archlinux-nix package from AUR to help set" + echo "things up." + echo + echo "For more information on how to use nix, check out Part III of the Nix Manual:" + echo + echo " https://nixos.org/nix/manual/#chap-package-management" + echo +} + +remove_info() { + echo "You may wish to do some clean up:" + echo + echo "1. delete /nix folder" + echo " # rm -r /nix" + echo + echo "2. delete the config dir" + echo " # rm -r /etc/nix" + echo + echo "3. you may also want to delete nix-related files from users' home dirs" + echo " # rm -r /root/.nix-* /home/*/.nix-*" + echo +} + +post_install() { + install_info +} + +post_remove() { + remove_info +}