0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 06:00:33 +03:00

oneteam: port to stdenv.mkDerivation

https://github.com/NixOS/nixpkgs/issues/4210
This commit is contained in:
Joachim Fasting 2016-08-29 00:58:53 +02:00
parent ec37e43c51
commit 20e228a1e1
No known key found for this signature in database
GPG key ID: 7544761007FE4E08

View file

@ -1,88 +1,64 @@
x@{builderDefsPackage { stdenv, fetchFromGitHub
, fetchgit, perl, xulrunner, cmake, perlPackages, zip, unzip, pkgconfig , perl, xulrunner, cmake, perlPackages, zip, unzip, pkgconfig
, libpulseaudio, glib, gtk, pixman, nspr, nss, libXScrnSaver, scrnsaverproto , libpulseaudio, glib, gtk, pixman, nspr, nss, libXScrnSaver
, ...}: , scrnsaverproto
builderDefsPackage }:
(a :
let
helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
["fetchgit" "perlPackages"];
buildInputs = map (n: builtins.getAttr n x) stdenv.mkDerivation rec {
(builtins.attrNames (builtins.removeAttrs x helperArgNames)) ++ [ name = "oneteam-unstable-2013-02-21";
a.perlPackages.SubName a.gtk a.glib
]; src = fetchFromGitHub {
sourceInfo = rec { repo = "oneteam";
baseName="oneteam"; owner = "processone";
version="git-head"; rev = "c51bc545c3a32db4ea8b96e43b84fcfc6b8d3d2a";
name="${baseName}-${version}"; sha256 = "19104fwdaf0nnsr5w755fg8wwww5sh96wmn939gxa5ah155nf2w3";
url="git://git.process-one.net/oneteam/oneteam.git";
rev="066cd861ea4436bbe363f032c58a746a1cac7498";
hash="972310d6ef20db7dc749d7d935aa50889afe2004db2a07409830e09ef639f30a";
method="fetchgit";
};
in
rec {
srcDrv = a.fetchgit {
url = sourceInfo.url;
sha256 = sourceInfo.hash;
rev = sourceInfo.rev;
}; };
src=srcDrv + "/"; nativeBuildInputs = [ pkgconfig cmake zip unzip ];
inherit (sourceInfo) name version; buildInputs =
inherit buildInputs; [ perl xulrunner libpulseaudio glib gtk pixman nspr
nss libXScrnSaver scrnsaverproto
] ++ [ perlPackages.SubName gtk glib ];
/* doConfigure should be removed if not needed */ postPatch = ''
phaseNames = ["goComponents" "setVars" "fixComponents" "doCmake"
"doMakeInstall" "goBack" "buildApp" "doDeploy"];
fixComponents = a.fullDepEntry ''
sed -e '1i#include <netinet/in.h>' -i src/rtp/otRTPDecoder.cpp src/rtp/otRTPEncoder.cpp sed -e '1i#include <netinet/in.h>' -i src/rtp/otRTPDecoder.cpp src/rtp/otRTPEncoder.cpp
'' ["minInit" "doUnpack"];
setVars=a.noDepEntry ''
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${nspr.dev}/include/nspr"
''; '';
cmakeBuildDir="cmake-build"; cmakeBuildDir = "cmake-build";
cmakeFlags=["-D XPCOM_GECKO_SDK=${xulrunner}/lib/xulrunner-devel-${xulrunner.version}"]; cmakeFlags = ["-D XPCOM_GECKO_SDK=${xulrunner}/lib/xulrunner-devel-${xulrunner.version}"];
goComponents=a.fullDepEntry "cd src/components" ["doUnpack"]; buildPhase = ''
goBack=a.noDepEntry "cd ../../.."; export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${nspr.dev}/include/nspr"
cd src/components
buildApp=a.fullDepEntry ''
perl build.pl XULAPP 1 perl build.pl XULAPP 1
'' ["addInputs"]; cd ../../
'';
doDeploy = a.fullDepEntry '' installPhase = ''
TARGET_DIR="$out/share/oneteam/app" TARGET_DIR="$out/share/oneteam/app"
BUILD_DIR="$PWD" BUILD_DIR="$PWD"
mkdir -p "$TARGET_DIR" mkdir -p "$TARGET_DIR"
cd "$TARGET_DIR" cd "$TARGET_DIR"
unzip "$BUILD_DIR/oneteam.xulapp" unzip "$BUILD_DIR/oneteam.xulapp"
mkdir -p "$out/bin" mkdir -p "$out/bin"
echo "#! ${a.stdenv.shell}" > "$out/bin/oneteam" echo "#! ${stdenv.shell}" > "$out/bin/oneteam"
echo "\"${xulrunner}/bin/xulrunner\" \"$TARGET_DIR/application.ini\"" > "$out/bin/oneteam" echo "\"${xulrunner}/bin/xulrunner\" \"$TARGET_DIR/application.ini\"" > "$out/bin/oneteam"
chmod a+x "$out/bin/oneteam" chmod a+x "$out/bin/oneteam"
mkdir -p "$out/share/doc" mkdir -p "$out/share/doc"
cp -r "$BUILD_DIR/docs" "$out/share/doc/oneteam" cp -r "$BUILD_DIR/docs" "$out/share/doc/oneteam"
'' ["defEnsureDir"]; '';
meta = { meta = {
description = "An XMPP client"; description = "An XMPP client";
maintainers = with a.lib.maintainers; maintainers = with stdenv.lib.maintainers; [ raskin ];
[ license = stdenv.lib.licenses.gpl2;
raskin
];
license = a.lib.licenses.gpl2;
homepage="http://oneteam.im"; homepage="http://oneteam.im";
}; };
passthru = { passthru = {
updateInfo = { updateInfo = {
downloadPage = "git://git.process-one.net/oneteam/oneteam.git"; downloadPage = "git://github.com/processone/oneteam";
}; };
}; };
}) x }