Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pascal Stücker
pakcs
Commits
0d25c19d
Commit
0d25c19d
authored
Nov 30, 2015
by
Lennart Spitzner
Browse files
Replace haskell package handling (package-db -> sandbox)
parent
5a932640
Changes
3
Show whitespace changes
Inline
Side-by-side
.gitignore
View file @
0d25c19d
...
...
@@ -29,7 +29,9 @@ make.log
curry2prolog/pakcsversion.pl
docs/src/version.tex
lib/
pkg/
.cabal-sandbox/
cabal.sandbox.config
# binaries
*.state
...
...
Makefile
View file @
0d25c19d
...
...
@@ -46,10 +46,8 @@ export DOCDIR = $(ROOT)/docs
C2PVERSION
=
$(ROOT)
/curry2prolog/pakcsversion.pl
# The version information file for the manual:
MANUALVERSION
=
$(DOCDIR)
/src/version.tex
# Directory where local package installations are stored
export
LOCALPKG
=
$(ROOT)
/pkg
# The path to the package database
export
PKGDB
=
$(LOCALPKG)
/pakcs.conf.d
# The sandbox directory used for installing haskell/cabal packages
export
ROOTSANDBOX
=
$(ROOT)
/.cabal-sandbox
# Various executables used in the installation
# --------------------------------------------
...
...
@@ -70,32 +68,12 @@ MAKELOG=make.log
# ----------------------------------------------------------
# The path to the Glasgow Haskell Compiler and Cabal
export
GHC
:=
$(
shell
which ghc
)
export
GHC-PKG
:=
$(
shell
dirname
"
$(GHC)
"
)
/ghc-pkg
export
CABAL
=
cabal
# Because of an API change in GHC 7.6,
# we need to distinguish GHC < 7.6 and GHC >= 7.6.
# GHC 7.6 renamed the option "package-conf" to "package-db".
# extract GHC version
GHC_MAJOR
:=
$(
shell
"
$(GHC)
"
--numeric-version
|
cut
-d
.
-f1
)
GHC_MINOR
:=
$(
shell
"
$(GHC)
"
--numeric-version
|
cut
-d
.
-f2
)
# Is the GHC version >= 7.6 ?
GHC_GEQ_76
=
$(
shell
test
$(GHC_MAJOR)
-gt
7
-o
\(
$(GHC_MAJOR)
-eq
7
\
-a
$(GHC_MINOR)
-ge
6
\)
;
echo
$$
?
)
# package-db (>= 7.6) or package-conf (< 7.6)?
ifeq
($(GHC_GEQ_76),0)
GHC_PKG_OPT
=
package-db
else
GHC_PKG_OPT
=
package-conf
endif
# Command to unregister a package
export
GHC
_UNREGISTER
=
"
$
(
GHC-PKG)"
unregister
--
$(GHC_PKG_OPT)
=
"
$(PKGDB)
"
export
PACKAGE
_UNREGISTER
=
"
$(
CABAL)
"
sandbox hc-pkg
--
unregister
# Command to install missing packages using cabal
export
CABAL_INSTALL
=
"
$(CABAL)
"
install
--with-compiler
=
"
$(GHC)
"
\
--with-hc-pkg
=
"
$
(GHC-PKG)"
--prefix
=
"
$(LOCALPKG)
"
\
--global
--package-db
=
"
$(PKGDB)
"
-O2
export
CABAL_INSTALL
=
"
$(CABAL)
"
install
--with-compiler
=
"
$(GHC)
"
-O2
########################################################################
# The targets
...
...
@@ -164,14 +142,13 @@ copylibs:
@
if
[
-d
lib-trunk
]
;
then
cd
lib-trunk
&&
$(MAKE)
-f
Makefile.
$(CURRYSYSTEM)
.install
;
fi
# create package database
$(PKGDB)
:
"
$
(GHC-PKG)"
init
$@
$(CABAL)
update
$(ROOTSANDBOX)
:
$(CABAL)
sandbox init
# install front end (if sources are present):
.PHONY
:
frontend
frontend
:
@
if
[
-d
frontend
]
;
then
$(MAKE)
$(
PKGDB
)
&&
cd
frontend
&&
$(MAKE)
;
fi
@
if
[
-d
frontend
]
;
then
$(MAKE)
$(
ROOTSANDBOX
)
&&
cd
frontend
&&
$(MAKE)
;
fi
# compile the tools:
.PHONY
:
tools
...
...
@@ -306,6 +283,7 @@ distdated: dist
mv
$(FULLNAME)
-
$(ARCH)
.tar.gz
$(FULLNAME)
-
$(DIST_DATE)
-
$(ARCH)
.tar.gz
# Clean all files that should not be included in a distribution
# DANGER; deletes .git (!)
.PHONY
:
cleandist
cleandist
:
rm
-rf
.git .gitmodules .gitignore
...
...
frontend/Makefile
View file @
0d25c19d
...
...
@@ -5,25 +5,41 @@
# Retrieve all Haskell modules as dependencies for cymake
DEPS
:=
$(
shell
find curry-base/src/ curry-frontend/src/
-type
f
)
# The sandbox config in curry-base linking to the root sandbox
SANDBOXBASECONF
:=
curry-base/cabal.sandbox.config
# The sandbox config in curry-frontend linking to the root sandbox
SANDBOXFRONTENDCONF
:=
curry-frontend/cabal.sandbox.config
# The sandbox config in . linking to the root sandbox
SANDBOXCONF
:=
cabal.sandbox.config
# install the sources of the front end from its repository
$(CYMAKE)
:
$(DEPS)
$(CYMAKE)
:
$(DEPS)
$(SANDBOXBASECONF) $(SANDBOXFRONTENDCONF)
$(MAKE)
unregister
mkdir
-p
$
(
@D
)
cd
curry-base
&&
$(CABAL_INSTALL)
$(MAKE)
transformers
# see below
cd
curry-frontend
&&
$(CABAL_INSTALL)
--bindir
=
$
(
@D
)
$(SANDBOXBASECONF)
:
cd
curry-base
&&
"
$(CABAL)
"
sandbox init
--sandbox
=
"
$(ROOTSANDBOX)
"
$(SANDBOXFRONTENDCONF)
:
cd
curry-frontend
&&
"
$(CABAL)
"
sandbox init
--sandbox
=
"
$(ROOTSANDBOX)
"
$(SANDBOXCONF)
:
"
$(CABAL)
"
sandbox init
--sandbox
=
"
$(ROOTSANDBOX)
"
# Temporary workaround for https://github.com/haskell/cabal/issues/1855
# see also http://www.haskell.org/pipermail/cabal-devel/2014-May/009795.html
.PHONY
:
transformers
transformers
:
transformers
:
$(SANDBOXCONF)
$(CABAL_INSTALL)
transformers-compat
-f
transformers3
# unregister previous version to avoid cabal install failures
.PHONY
:
unregister
unregister
:
-
$(
GHC
_UNREGISTER)
curry-frontend
-
$(
GHC
_UNREGISTER)
curry-base
unregister
:
$(SANDBOXCONF)
-
$(
PACKAGE
_UNREGISTER)
curry-frontend
-
$(
PACKAGE
_UNREGISTER)
curry-base
.PHONY
:
clean
clean
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment