From 4727165832fd6daa26d662b9ae5f12f39d1c7061 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 18 Sep 2014 12:24:05 +0200 Subject: [PATCH] Use pkgconfig to find Nix --- configure.ac | 23 +---------------------- release.nix | 9 +++------ src/c/Makefile.am | 6 ++---- 3 files changed, 6 insertions(+), 32 deletions(-) diff --git a/configure.ac b/configure.ac index 6e220b56..5a1939f5 100644 --- a/configure.ac +++ b/configure.ac @@ -35,14 +35,6 @@ fi NEED_PROG(perl, perl) -AC_ARG_WITH(nix, AC_HELP_STRING([--with-nix=PATH], - [prefix of nix]), - nix=$withval, nix=/nix-missing) -AC_SUBST(nix) - -PATH="$nix/bin:$PATH" -export PATH - NEED_PROG([NIX_STORE_PROGRAM], [nix-store]) AC_MSG_CHECKING([whether $NIX_STORE_PROGRAM is recent enough]) @@ -61,21 +53,8 @@ else AC_MSG_ERROR([`$NIX_STORE_PROGRAM' doesn't support `--timeout'; please use a newer version.]) fi -old_CPPFLAGS="$CPPFLAGS" -old_LIBS="$LIBS" +PKG_CHECK_MODULES([NIX], [nix-main nix-expr nix-store]) -CPPFLAGS="$CPPFLAGS -I$nix/include/nix" -LDFLAGS="$LDFLAGS -L$nix/lib" - -AC_CHECK_HEADER([store-api.hh], [:], - [AC_MSG_ERROR([Nix headers not found; please install Nix or check the `--with-nix' option.])]) -AC_CHECK_LIB([nixexpr], [_ZN3nix9EvalStateC1ERKSt4listISsSaISsEE], [:], - [AC_MSG_ERROR([Nix library not found; please install Nix or check the `--with-nix' option.])]) - -CPPFLAGS="$old_CPPFLAGS" -LIBS="$old_LIBS" - -PKG_CHECK_MODULES([BDW_GC], [bdw-gc]) PKG_CHECK_MODULES([GUILE], [guile-2.0], [HAVE_GUILE=yes], [HAVE_GUILE=no]) if test "x$HAVE_GUILE" = xyes; then diff --git a/release.nix b/release.nix index ecc28d09..4ad17bd7 100644 --- a/release.nix +++ b/release.nix @@ -37,7 +37,7 @@ in rec { version = builtins.readFile ./version; buildInputs = - [ perl libxslt dblatex tetex nukeReferences pkgconfig boehmgc git openssl ]; + [ perl libxslt dblatex tetex nukeReferences pkgconfig nixUnstable git openssl ]; versionSuffix = if officialRelease then "" else "pre${toString hydraSrc.revCount}-${hydraSrc.gitTag}"; @@ -51,9 +51,7 @@ in rec { ''; configureFlags = - [ "--with-nix=${nixUnstable}" - "--with-docbook-xsl=${docbook_xsl}/xml/xsl/docbook" - ]; + [ "--with-docbook-xsl=${docbook_xsl}/xml/xsl/docbook" ]; postDist = '' make -C doc/manual install prefix="$out" @@ -128,10 +126,9 @@ in rec { releaseTools.nixBuild { name = "hydra"; src = tarball; - configureFlags = "--with-nix=${nix}"; buildInputs = - [ makeWrapper libtool unzip nukeReferences pkgconfig boehmgc sqlite + [ makeWrapper libtool unzip nukeReferences pkgconfig sqlite gitAndTools.topGit mercurial darcs subversion bazaar openssl bzip2 guile # optional, for Guile + Guix support perlDeps perl diff --git a/src/c/Makefile.am b/src/c/Makefile.am index f5ea536e..c31849d9 100644 --- a/src/c/Makefile.am +++ b/src/c/Makefile.am @@ -1,8 +1,6 @@ bin_PROGRAMS = hydra-eval-jobs hydra_eval_jobs_SOURCES = hydra-eval-jobs.cc -hydra_eval_jobs_LDADD = -lnixmain -lnixexpr -L$(nix)/lib/nix $(BDW_GC_LIBS) +hydra_eval_jobs_LDADD = $(NIX_LIBS) -AM_CXXFLAGS = \ - -I$(nix)/include/nix \ - $(BDW_GC_CFLAGS) +AM_CXXFLAGS = $(NIX_CFLAGS)