Skip to content

Commit

Permalink
Simplify building nix-perl in nix-shell
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Apr 26, 2017
1 parent 6734c18 commit 98a2adb
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion perl/Makefile
@@ -1,6 +1,6 @@
makefiles = local.mk

GLOBAL_CXXFLAGS += -std=c++14 -g -Wall -include nix/config.h
GLOBAL_CXXFLAGS += -std=c++14 -g -Wall

-include Makefile.config

Expand Down
2 changes: 1 addition & 1 deletion perl/configure.ac
Expand Up @@ -98,7 +98,7 @@ for name in $ac_subst_vars; do
done

rm -f Makefile.config
ln -s ../mk mk
ln -sfn ../mk mk

AC_CONFIG_FILES([])
AC_OUTPUT
2 changes: 2 additions & 0 deletions perl/lib/Nix/Store.xs
@@ -1,3 +1,5 @@
#include "config.h"

#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
Expand Down
6 changes: 3 additions & 3 deletions perl/local.mk
Expand Up @@ -20,11 +20,11 @@ Store_DIR := lib/Nix
Store_SOURCES := $(Store_DIR)/Store.cc

Store_CXXFLAGS = \
-I$(shell $(perl) -e 'use Config; print $$Config{archlibexp};')/CORE \
$(NIX_CFLAGS) \
-I$(shell perl -e 'use Config; print $$Config{archlibexp};')/CORE \
-D_FILE_OFFSET_BITS=64 \
-Wno-unknown-warning-option -Wno-unused-variable -Wno-literal-suffix \
-Wno-reserved-user-defined-literal -Wno-duplicate-decl-specifier -Wno-pointer-bool-conversion \
$(NIX_CFLAGS)
-Wno-reserved-user-defined-literal -Wno-duplicate-decl-specifier -Wno-pointer-bool-conversion

Store_LDFLAGS := $(SODIUM_LIBS) $(NIX_LIBS)

Expand Down
9 changes: 8 additions & 1 deletion shell.nix
Expand Up @@ -17,6 +17,10 @@ with import <nixpkgs> {};
})
autoreconfHook
readline

# For nix-perl
perl
perlPackages.DBDSQLite
];

configureFlags =
Expand All @@ -30,6 +34,9 @@ with import <nixpkgs> {};

shellHook =
''
configureFlags+=" --prefix=$(pwd)/inst"
export prefix=$(pwd)/inst
configureFlags+=" --prefix=prefix"
PKG_CONFIG_PATH=$prefix/lib/pkgconfig:$PKG_CONFIG_PATH
PATH=$prefix/bin:$PATH
'';
}

0 comments on commit 98a2adb

Please sign in to comment.