Skip to content

Commit

Permalink
🐛 Fix packaging stuff + nixos
Browse files Browse the repository at this point in the history
  • Loading branch information
trickypr committed Jun 17, 2024
1 parent acafecf commit 2b3d8ec
Show file tree
Hide file tree
Showing 7 changed files with 310 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_url "https://raw.githubusercontent.com/cachix/devenv/95f329d49a8a5289d31e0982652f7058a189bfca/direnvrc" "sha256-d+8cBpDfDBj41inrADaJt+bDWhOktwslgoP5YiGJ1v0="

use devenv
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,16 @@ node_modules/
engine/
.gluon/
dist/
# Devenv
.devenv*
devenv.local.nix

# direnv
.direnv

# pre-commit
.pre-commit-config.yaml

# System mozillabuild
mozillabuild

161 changes: 161 additions & 0 deletions devenv.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
{
"nodes": {
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1718265154,
"owner": "cachix",
"repo": "devenv",
"rev": "1983f635c29dc68bb0d29b3a7e227579a1d98788",
"treeHash": "65018ab26133a442cd98ab058d07be455165a203",
"type": "github"
},
"original": {
"dir": "src/modules",
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"fenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1717827974,
"owner": "nix-community",
"repo": "fenix",
"rev": "ab655c627777ab5f9964652fe23bbb1dfbd687a8",
"treeHash": "a558435d5e7684dcdaf311568caba126c935252a",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"treeHash": "2addb7b71a20a25ea74feeaf5c2f6a6b30898ecb",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"treeHash": "ca14199cabdfe1a06a7b1654c76ed49100a689f9",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1716977621,
"owner": "cachix",
"repo": "devenv-nixpkgs",
"rev": "4267e705586473d3e5c8d50299e71503f16a6fb6",
"treeHash": "6d9f1f7ca0faf1bc2eeb397c78a49623260d3412",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "rolling",
"repo": "devenv-nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1718060059,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a3c8d64ba846725f040582b2d3b875466d2115bd",
"treeHash": "4378720d991b2af92b2e078b80bff5ec363a11c5",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1717664902,
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1",
"treeHash": "def977583217aad11744d144c1f7fc216ce450bf",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"fenix": "fenix",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks"
}
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1718185781,
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "fa486e694e1fe7774f20350bb15ff933f670dc3c",
"treeHash": "d5c8aa18755af93f07200192dfba2a16379cb666",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
}
},
"root": "root",
"version": 7
}
124 changes: 124 additions & 0 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{ pkgs, lib, config, inputs, stdenv, ... }:

{
env.LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";

languages.c.enable = true;
languages.cplusplus.enable = true;
languages.rust.enable = true;
# https://devenv.sh/reference/options/#languagesrustchannel
languages.rust.channel = "stable";

packages = with pkgs; [
sccache
unzip

libllvm
libclang
llvm
alsa-lib
libpulseaudio
rust-cbindgen
libclang
gcc

libxkbcommon libdrm

# build time
autoconf
cargo
dump_syms
makeWrapper
mimalloc
nodejs
perl
pkg-config
python3
rustc
rust-cbindgen
unzip
which

# runtime
bzip2
dbus
dbus-glib
file
fontconfig
freetype
glib
gnum4
gtk3
icu
icu72
libGL
libGLU
libevent
libffi
libjpeg
libpng
libstartup_notification
libvpx
libwebp
nasm
nspr
nss_latest
pango
zip
zlib

bzip2
dbus
dbus-glib
file
fontconfig
freetype
glib
gtk3
libffi
libGL
libGLU
libevent
libjpeg
libpng
libstartup_notification
libvpx
libwebp
nasm
nspr
pango
perl
xorg.libX11
xorg.libXcursor
xorg.libXdamage
xorg.libXext
xorg.libXft
xorg.libXi
xorg.libXrender
xorg.libXt
xorg.libXtst
xorg.pixman
xorg.xorgproto
zip
zlib
];

enterShell = ''
cxxLib=$( echo -n ${pkgs.gcc}/include/c++/* )
archLib=$cxxLib/$( ${pkgs.gcc}/bin/gcc -dumpmachine )
UNSET AS
cat - > mozconfig <<EOF
ac_add_options --disable-bootstrap
#ac_add_options --without-wasm-sandboxed-libraries # this may be needed
#mk_add_options AUTOCONF={autoconf213}/bin/autoconf
ac_add_options --with-libclang-path=${pkgs.libclang.lib}/lib
#ac_add_options --with-clang-path=${pkgs.clang}/bin/clang
#export BINDGEN_CFLAGS="-cxx-isystem $cxxLib -isystem $archLib"
#export LIBCLANG_PATH="${pkgs.libclang.lib}/lib"
#export CC="${pkgs.gcc}/bin/cc"
#export CXX="${pkgs.gcc}/bin/c++"
EOF
'';
}
8 changes: 8 additions & 0 deletions devenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
inputs:
nixpkgs:
url: github:cachix/devenv-nixpkgs/rolling
fenix:
url: github:nix-community/fenix
inputs:
nixpkgs:
follows: nixpkgs
2 changes: 1 addition & 1 deletion gluon.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
],
"licenseType": "MPL-2.0"
}
}
}
20 changes: 0 additions & 20 deletions src/quark-runtime/installer/package-manifest.in
Original file line number Diff line number Diff line change
Expand Up @@ -351,26 +351,6 @@ bin/libfreebl_64int_3.so
@BINPATH@/maintenanceservice_installer.exe
#endif

; [Crash Reporter]
;
#ifdef MOZ_CRASHREPORTER
#ifdef XP_MACOSX
@BINPATH@/crashreporter.app/
#else
@BINPATH@/crashreporter@BIN_SUFFIX@
@RESPATH@/crashreporter.ini
#ifdef XP_UNIX
@RESPATH@/Throbber-small.gif
#elif defined(XP_WIN)
@BINPATH@/@DLL_PREFIX@mozwer@DLL_SUFFIX@
#endif
#endif
;@RESPATH@/browser/crashreporter-override.ini
#ifdef MOZ_CRASHREPORTER_INJECTOR
@BINPATH@/breakpadinjector.dll
#endif
#endif

; [ minidump-analyzer ]
;
#ifdef MOZ_CRASHREPORTER
Expand Down

0 comments on commit 2b3d8ec

Please sign in to comment.