release.nix 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. with import <nixpkgs/lib>;
  2. let
  3. libhttpseverywhere = pkgs: with pkgs; stdenv.mkDerivation rec {
  4. name = "libhttpseverywhere-${version}";
  5. version = "0.0.2";
  6. src = fetchgit {
  7. url = "https://github.com/grindhold/libhttpseverywhere/";
  8. sha256 = "0hp9szklp8g5bkcm47vbkhspwjdm5x4ghhgwp9yd201s2qkl0hsq";
  9. rev = "5827c6bca6891a136e4f93768f642f57b5d1cbd9"; # Version 0.0.2
  10. fetchSubmodules = true;
  11. };
  12. patches = [ ./libhttpseverywhere_no_rulesets_target.patch ];
  13. dontUseCmakeBuildDir = true;
  14. buildInputs = [
  15. cmake vala_0_28 pkgconfig glib gtk3 gnome3.libgee libxml2 git
  16. ];
  17. };
  18. rainbowLollipop = pkgs: with pkgs; stdenv.mkDerivation rec {
  19. name = "rainbow-lollipop-${version}";
  20. version = "0.0.1";
  21. src = ./.;
  22. dontUseCmakeBuildDir = true;
  23. buildInputs = [
  24. cmake vala_0_28 zeromq pkgconfig glib gtk3 clutter_gtk webkitgtk
  25. gnome3.libgee sqlite gettext epoxy (libhttpseverywhere pkgs)
  26. ] ++ optionals (!(stdenv ? cross)) [
  27. udev xorg.libpthreadstubs xorg.libXdmcp xorg.libxshmfence libxkbcommon
  28. ];
  29. };
  30. supportedSystems = [
  31. "i686-linux" "x86_64-linux" "i686-w64-mingw32" "x86_64-w64-mingw32"
  32. ];
  33. getSysAttrs = system: if hasSuffix "-w64-mingw32" system then {
  34. crossSystem = let
  35. is64 = hasPrefix "x86_64" system;
  36. in {
  37. config = system;
  38. arch = if is64 then "x86_64" else "x86";
  39. libc = "msvcrt";
  40. platform = {};
  41. openssl.system = "mingw${optionalString is64 "64"}";
  42. };
  43. } else {
  44. inherit system;
  45. };
  46. withSystem = system: let
  47. sysAttrs = getSysAttrs system;
  48. pkgs = import <nixpkgs> sysAttrs;
  49. result = rainbowLollipop pkgs;
  50. in if sysAttrs ? crossSystem then result.crossDrv else result;
  51. in {
  52. build = genAttrs supportedSystems withSystem;
  53. }