commit 9533492a87cb10b21c10b0017a873b33e5faa4fc
Author: Jakub Bogusz <[email protected]>
Date:   Thu Apr 23 17:31:14 2020 +0200

    - up to 2.3.4
    - added sh patch (remove bashism from configure)
    - added paths patch (adjust systemd units path)

 nix-paths.patch |   9 +++
 nix-sh.patch    |  15 +++++
 nix.spec        | 184 ++++++++++++++++++++++++++++++++++++--------------------
 3 files changed, 142 insertions(+), 66 deletions(-)
---
diff --git a/nix.spec b/nix.spec
index b40d25e..b910ee5 100644
--- a/nix.spec
+++ b/nix.spec
@@ -1,23 +1,48 @@
-# TODO: FHS (/nix, /var/nix are invalid)
+#
+# Conditional build:
+%bcond_with    perl    # Perl module (needs update: uses C++11, while main 
libs need C++17 now)
+
 Summary:       A purely functional package manager
 Summary(pl.UTF-8):     Czysto funkcyjny zarządca pakietów
 Name:          nix
-Version:       0.11
-Release:       0.3
+Version:       2.3.4
+Release:       0.1
 License:       LGPL v2.1+
 Group:         Applications/System
-Source0:       
http://nix.cs.uu.nl/dist/nix/%{name}-%{version}/%{name}-%{version}.tar.bz2
-# Source0-md5: 890c25ac0005ff466683869efc288b67
-URL:           http://nix.cs.uu.nl/
+Source0:       
https://nixos.org/releases/nix/%{name}-%{version}/%{name}-%{version}.tar.xz
+# Source0-md5: 0d8486cb6622bb53116200d3a3d378ca
+Patch0:                %{name}-sh.patch
+Patch1:                %{name}-paths.patch
+URL:           https://nixos.org/nix/
+# aws-sdk-cpp/aws-cpp-sdk-s3 (aws/s3/S3Client.h)
+BuildRequires: boost-devel >= 1.66
 BuildRequires: bzip2-devel
-BuildRequires: db-cxx-devel
+%{?with_perl:BuildRequires:    curl}
+BuildRequires: curl-devel
+BuildRequires: editline-devel >= 1.15.2
+BuildRequires: gc-devel
+BuildRequires: libbrotli-devel
+BuildRequires: libseccomp-devel
+BuildRequires: libsodium-devel
+BuildRequires: libstdc++-devel >= 6:7
 BuildRequires: openssl-devel
+BuildRequires: sqlite3-devel >= 3.6.19
+%if %{with perl}
+BuildRequires: perl-DBI
+BuildRequires: perl-DBD-SQLite
 BuildRequires: perl-base >= 1:5.8.0
-Requires:      curl
+%endif
+BuildRequires: tar >= 1:1.22
+BuildRequires: xz
+BuildRequires: xz-devel
+Requires:      %{name}-libs = %{version}-%{release}
+Obsoletes:     nix-emacs-mode
 Provides:      /var/nix/manifests
 Provides:      /var/nix/profiles
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%define                nixdir          /var/lib/nix
+
 %description
 Nix is a purely functional package manager. It allows multiple
 versions of a package to be installed side-by-side, ensures that
@@ -32,89 +57,116 @@ zależności, umożliwia niepodzielną aktualizację systemu i 
wycofanie do
 poprzedniej wersji, pozwala na instalację oprogramowania przez
 użytkowników. Posiada też wiele innych funkcji.
 
+%package libs
+Summary:       Nix libraries
+Summary(pl.UTF-8):     Biblioteki Niksa
+Group:         Libraries
+
+%description libs
+Nix libraries.
+
+%description libs -l pl.UTF-8
+Biblioteki Niksa.
+
 %package devel
-Summary:       Header files for nix
-Summary(pl.UTF-8):     Pliki nagłówkowe niksa
+Summary:       Header files for Nix
+Summary(pl.UTF-8):     Pliki nagłówkowe Niksa
 Group:         Development/Libraries
-Requires:      %{name} = %{version}-%{release}
+Requires:      %{name}-libs = %{version}-%{release}
+Requires:      gc-devel
+Requires:      libstdc++-devel >= 6:7
 
 %description devel
-Header files for nix.
+Header files for Nix.
 
 %description devel -l pl.UTF-8
-Pliki nagłówkowe niksa.
-
-%package emacs-mode
-Summary:       Emacs mode for nix expressions
-Summary(pl.UTF-8):     Tryb Emacsa dla wyrażeń niksa
-Group:         Applications/Editors/Emacs
-Requires:      emacs
-
-%description emacs-mode
-Emacs mode for nix expressions.
-
-%description emacs-mode -l pl.UTF-8
-Tryb Emacsa dla wyrażeń niksa.
+Pliki nagłówkowe Niksa.
 
 %prep
 %setup -q
+%patch0 -p1
+%patch1 -p1
 
 %build
+%{__aclocal} -I m4
+%{__autoconf}
+%{__autoheader}
+%configure \
+       --localstatedir=%{nixdir}/var \
+       --with-store-dir=%{nixdir}/store
+
+%{__make} \
+       V=1
+
+%if %{with perl}
+ln -sf nix src/nix/nix-instantiate
+topdir=$(pwd)
+cd perl
 %configure \
-       curl=/usr/bin/curl \
-       --with-bzip2=/usr \
-       --with-bdb=/usr \
-       --with-store-dir=/%{name}/store
-%{__make}
+       NIX_CFLAGS="-I$topdir/src/libstore -I$topdir/src/libutil" \
+       NIX_LIBS="-L$topdir/src/libstore -lnixstore" \
+       NIX_INSTANTIATE_PROGRAM="$topdir/src/nix/nix-instantiate"
+
+%{__make} \
+       V=1
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT/%{name}/store
-mkdir -p $RPM_BUILD_ROOT/%{name}/var
-mv $RPM_BUILD_ROOT%{_localstatedir}/%{name} $RPM_BUILD_ROOT/%{name}/var
-ln -s /%{name}/var/%{name} $RPM_BUILD_ROOT%{_localstatedir}/%{name}
-mkdir $RPM_BUILD_ROOT/%{name}/var/log
-ln -s %{_localstatedir}/log/%{name} $RPM_BUILD_ROOT/%{name}/var/log
+
+%if %{with perl}
+%{__make} -C perl install \
+       DESTDIR=$RPM_BUILD_ROOT
+%endif
+
+install -d $RPM_BUILD_ROOT%{nixdir}/{store,var/nix/{gcroots,profiles}/per-user}
+
+# dead upstart stuff
+%{__rm} -r $RPM_BUILD_ROOT/etc/init
+# packaged as %doc
+%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/manual
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc AUTHORS NEWS doc/manual/manual.html doc/manual/figures doc/manual/images
-%attr(755,root,root) %{_bindir}/*
-%dir %{_datadir}/%{name}
-%dir %{_datadir}/%{name}/corepkgs
-%dir %{_datadir}/%{name}/corepkgs/*
-%attr(755,root,root) %{_datadir}/%{name}/corepkgs/*/*.pl
-%attr(755,root,root) %{_datadir}/%{name}/corepkgs/*/*.sh
-%{_datadir}/%{name}/corepkgs/*/*.nix
-%{_datadir}/%{name}/log2html
-%{_datadir}/%{name}/manual
-%attr(755,root,root) %{_libdir}/bsdiff
-%attr(755,root,root) %{_libdir}/bspatch
-%attr(755,root,root) %{_libdir}/nix-setuid-helper
+%doc README.md doc/manual/{manual.html,figures,images}
+%attr(755,root,root) %{_bindir}/nix*
 %dir %{_libdir}/%{name}
-%attr(755,root,root) %{_libdir}/%{name}/*.pl
-%attr(755,root,root) %{_libdir}/%{name}/*.so*
-%{_libdir}/%{name}/*.pm
-%{_localstatedir}/log/%{name}
-%{_localstatedir}/%{name}
-%{_mandir}/man*/*
-/%{name}
-%dir %{_sysconfdir}/%{name}
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/nix.conf
-%{_sysconfdir}/%{name}/nix.conf.example
-%attr(755,root,root) %{_sysconfdir}/profile.d/nix.sh
-
-%files devel
+%attr(755,root,root) %{_libdir}/%{name}/build-remote
+%dir %{_datadir}/%{name}
+%{_datadir}/%{name}/corepkgs
+%{_datadir}/%{name}/sandbox
+%{systemdunitdir}/nix-daemon.service
+%{systemdunitdir}/nix-daemon.socket
+/etc/profile.d/nix.sh
+/etc/profile.d/nix-daemon.sh
+%dir %{nixdir}
+%attr(1775,root,root) %dir %{nixdir}/store
+%dir %{nixdir}/var
+%dir %{nixdir}/var/nix
+%dir %{nixdir}/var/nix/gcroots
+%dir %{nixdir}/var/nix/gcroots/per-user
+%dir %{nixdir}/var/nix/profiles
+%dir %{nixdir}/var/nix/profiles/per-user
+%{_mandir}/man1/nix-*.1*
+%{_mandir}/man5/nix.conf.5*
+%{_mandir}/man8/nix-daemon.8*
+
+%files libs
 %defattr(644,root,root,755)
-%{_includedir}/%{name}
-%{_libdir}/%{name}/*.la
+%attr(755,root,root) %{_libdir}/libnixexpr.so
+%attr(755,root,root) %{_libdir}/libnixmain.so
+%attr(755,root,root) %{_libdir}/libnixstore.so
+%attr(755,root,root) %{_libdir}/libnixutil.so
 
-%files emacs-mode
+%files devel
 %defattr(644,root,root,755)
-%{_datadir}/emacs/site-lisp/*.el
+%{_includedir}/nix
+%{_pkgconfigdir}/nix-expr.pc
+%{_pkgconfigdir}/nix-main.pc
+%{_pkgconfigdir}/nix-store.pc
diff --git a/nix-paths.patch b/nix-paths.patch
new file mode 100644
index 0000000..541440b
--- /dev/null
+++ b/nix-paths.patch
@@ -0,0 +1,9 @@
+--- nix-2.3.4/misc/systemd/local.mk.orig       1970-01-01 01:00:01.000000000 
+0100
++++ nix-2.3.4/misc/systemd/local.mk    2020-04-21 18:43:49.318065743 +0200
+@@ -1,5 +1,5 @@
+ ifeq ($(OS), Linux)
+ 
+-  $(foreach n, nix-daemon.socket nix-daemon.service, $(eval $(call 
install-file-in, $(d)/$(n), $(prefix)/lib/systemd/system, 0644)))
++  $(foreach n, nix-daemon.socket nix-daemon.service, $(eval $(call 
install-file-in, $(d)/$(n), /lib/systemd/system, 0644)))
+ 
+ endif
diff --git a/nix-sh.patch b/nix-sh.patch
new file mode 100644
index 0000000..ca458ac
--- /dev/null
+++ b/nix-sh.patch
@@ -0,0 +1,15 @@
+--- nix-2.3.4/configure.ac.orig        1970-01-01 01:00:01.000000000 +0100
++++ nix-2.3.4/configure.ac     2020-04-21 12:04:21.564576870 +0200
+@@ -235,9 +235,9 @@
+ AC_LANG_POP(C++)
+ 
+ if test -n "$enable_s3"; then
+-  declare -a aws_version_tokens=($(printf '#include 
<aws/core/VersionConfig.h>\nAWS_SDK_VERSION_STRING' | $CPP $CPPFLAGS - | grep 
-v '^#.*' | sed 's/"//g' | tr '.' ' '))
+-  AC_DEFINE_UNQUOTED([AWS_VERSION_MAJOR], ${aws_version_tokens@<:@0@:>@}, 
[Major version of aws-sdk-cpp.])
+-  AC_DEFINE_UNQUOTED([AWS_VERSION_MINOR], ${aws_version_tokens@<:@1@:>@}, 
[Minor version of aws-sdk-cpp.])
++  aws_version="$(printf '#include 
<aws/core/VersionConfig.h>\nAWS_SDK_VERSION_STRING' | $CPP $CPPFLAGS - | grep 
-v '^#.*' | sed 's/"//g')"
++  AC_DEFINE_UNQUOTED([AWS_VERSION_MAJOR], $(echo "$aws_version" | cut -d. 
-f1), [Major version of aws-sdk-cpp.])
++  AC_DEFINE_UNQUOTED([AWS_VERSION_MINOR], $(echo "$aws_version" | cut -d. 
-f2), [Minor version of aws-sdk-cpp.])
+ fi
+ 
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/nix.git/commitdiff/9533492a87cb10b21c10b0017a873b33e5faa4fc

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to