2014-10-20 01:16:59 +02:00
|
|
|
{ stdenv, makeWrapper, requireFile, patchelf, rpmextract, libaio }:
|
2013-03-07 07:49:26 +01:00
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "oracle-xe";
|
2013-03-07 07:49:26 +01:00
|
|
|
version = "11.2.0";
|
|
|
|
|
|
|
|
src = requireFile {
|
2019-08-15 14:41:18 +02:00
|
|
|
name = "${pname}-${version}-1.0.x86_64.rpm";
|
2013-03-07 07:49:26 +01:00
|
|
|
sha256 = "0s2jj2xn56v5ys6hxb7l7045hw9c1mm1lhj4p2fvqbs02kqchab6";
|
|
|
|
|
|
|
|
url = "http://www.oracle.com/technetwork/"
|
|
|
|
+ "products/express-edition/downloads/";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
unpackCmd = ''
|
2019-08-15 14:41:18 +02:00
|
|
|
(mkdir -p "${pname}-${version}" && cd "${pname}-${version}" &&
|
2014-10-20 01:16:59 +02:00
|
|
|
${rpmextract}/bin/rpmextract "$curSrc")
|
2013-03-07 07:49:26 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = let
|
|
|
|
libs = makeLibraryPath [ libaio ];
|
|
|
|
in ''
|
|
|
|
basedir="u01/app/oracle/product/${version}/xe"
|
|
|
|
cat > "$basedir/network/admin/listener.ora" <<SQL
|
|
|
|
# listener.ora Network Configuration File:
|
|
|
|
|
|
|
|
SID_LIST_LISTENER =
|
|
|
|
(SID_LIST =
|
|
|
|
(SID_DESC =
|
|
|
|
(SID_NAME = PLSExtProc)
|
|
|
|
(ORACLE_HOME = ''${out}/libexec/oracle)
|
|
|
|
(PROGRAM = extproc)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
LISTENER =
|
|
|
|
(DESCRIPTION_LIST =
|
|
|
|
(DESCRIPTION =
|
|
|
|
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
|
|
|
|
(ADDRESS = (PROTOCOL = TCP)(HOST = %hostname%)(PORT = %port%))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
DEFAULT_SERVICE_LISTENER = (XE)
|
|
|
|
SQL
|
|
|
|
|
|
|
|
find u01 \
|
|
|
|
\( -name '*.sh' \
|
|
|
|
-o -path "$basedir/bin/*" \
|
|
|
|
\) -print -exec "${patchelf}/bin/patchelf" \
|
2014-12-17 19:11:30 +01:00
|
|
|
--interpreter "$(cat "$NIX_CC/nix-support/dynamic-linker")" \
|
2013-03-07 07:49:26 +01:00
|
|
|
--set-rpath "${libs}:$out/libexec/oracle/lib" \
|
|
|
|
--force-rpath '{}' \;
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out/libexec"
|
|
|
|
cp -r "u01/app/oracle/product/${version}/xe" "$out/libexec/oracle"
|
|
|
|
|
|
|
|
for i in "$out/libexec/oracle/bin"/*; do
|
|
|
|
makeWrapper "$i" "$out/bin/''${i##*/}" \
|
|
|
|
--set ORACLE_HOME "$out/libexec/oracle" \
|
|
|
|
--set ORACLE_SID XE \
|
2017-11-20 00:50:49 +01:00
|
|
|
--run "export NLS_LANG=\$($out/libexec/oracle/bin/nls_lang.sh)" \
|
2013-03-07 07:49:26 +01:00
|
|
|
--prefix PATH : "$out/libexec/oracle/bin"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Oracle Database Express Edition";
|
2017-08-01 22:03:30 +02:00
|
|
|
homepage = http://www.oracle.com/technetwork/products/express-edition/;
|
2013-04-12 14:37:50 +02:00
|
|
|
license = licenses.unfree;
|
2018-05-03 07:58:11 +02:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2013-03-07 07:49:26 +01:00
|
|
|
};
|
|
|
|
}
|