Commit Graph

24 Commits

Author SHA1 Message Date
Jakub Sokołowski 5d9a29b3c8
nix: cleanup of unused variables
Mostly achieved by running via `nix-linter`.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2022-05-31 12:03:20 +02:00
Jakub Sokołowski 0652d18653
nix: upgrade nixpkgs, keep Go at 1.14.15
Notable software upgrades:

- Go `1.14.13` to `1.14.15`
- Clojure `1.10.1.763` to `1.10.3.855`
- NodeJS `12.20.1` to `12.22.1`
- Git `2.29.2` to `2.31.1`
- CMake `3.10.2` to `3.18.1`
- Curl `7.74.0` to `7.76.1`
- Android NDK `21.3.6528147` to `22.1.7171670`
- Android Platform Tools `30.0.5` to `31.0.2`

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2021-06-15 17:49:33 +02:00
Jakub Sokołowski 32efcb06a0
nix: make status-go version regex even more lax
In release `1.7.0` we had an issue with `status-go` version `v0.62.3.hotfix.3`
not matching [Semantic Versionig](https://semver.org/#spec-item-11) so a fix was
introduced in https://github.com/status-im/status-react/pull/11331 that made the regex a bit more lax.

Again in `1.9.0` we had the same issue and the release not appears as `develop`
instead of the actual `status-go` version, which this time was `0.63.8+hotfix.2`.
Notice the `+` instead of `-` or `.` before `hotfix.2`.

I've added `+` to allowed characters after the 3 digit standard version format.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2020-12-01 20:18:03 +01:00
Jakub Sokołowski 973bdb61b3
nix: make status-go matching regex more lax
We had an issue where the `1.7.0` release was using the `v0.62.3.hotfix.3`
version of `status-go` which didn't match the regex we use to verify
if the specified version is a valid version according to [Semantic Versioning](https://semver.org/).

You can check the current regex here: https://regex101.com/r/OeTQCv/3

I also added a trace message to show when we mark a build as `develop`.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2020-10-26 13:02:50 +01:00
Jakub Sokołowski 933c0f8f8c
nix: allow XCode versions 11.5 and higher
This is kinda hacky, but is simple enough since the version check uses grep.

For details see:
https://github.com/status-im/nixpkgs/blob/status-mods/pkgs/development/mobile/xcodeenv/compose-xcodewrapper.nix

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2020-07-31 13:04:47 +02:00
Jakub Sokołowski f2c96dcd3b
nix: add config defaults and temp keystore generation
Changes:
* Create `nix/config.nix` with `config` defaults
* Add `nix/tools/gradlePropParser.nix` for reading `gradle.properties`
* Add `nix/mobile/android/keystore.nix` for generating a keystore
* Load keystore generation in `nix/mobile/android/default.nix`
* Use generated keystore if it's not provided via `config`
* Add `-deststoretype pkcs12` in `scripts/generate-keystore.sh`
* Add `nix/lib/assertEnvVarSet.nix` for checking if env var is set

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2020-06-04 11:10:48 +02:00
Jakub Sokołowski 604362958b
nix: always use patched node_modules in shells
Becuase `clojure` shell used unpatched `node_modules` while the
`android` shell used the patched version when starting these shells
the `node_modules` would keep being switched between them wasting time.

Changes:
- Move `nix/tools/patchNodeModules.nix` to `nix/deps/nodejs-patched`
- Make `nix/deps/nodejs-patched` a normal derivation without extra arguments
- Use `deps.nodejs-patched` in `nix/mobile/android` shell
- Use `deps.nodejs-patched` in `nix/shells.nix` node shell
- Use `with pkgs` to reduce arguments in `nix/mobile/android/release.nix`

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2020-05-18 13:54:26 +02:00
Jakub Sokołowski 559a79b3d5
nix: move jetify-ing Java files to patchNodeModules
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2020-05-15 22:44:40 +02:00
Jakub Sokołowski 73a8992db7
nix: refactor loading of node.js modules
Changes:
- Drop `nix/mobile/android/maven-and-npm-deps/default.nix`
- Replace it with much simpler `nix/tools/patchNodeModules`
- Move Gradle patching tool to `nix/pkgs/patch-maven-srcs`
- Simplify it by using `gradle.deps` and patched node modules separately
- Change `TARGET` for `release-android` to `default`
- Move `mobile/reset-node_modules.sh` to `scripts/node_modules.sh`
- Move `nix/mobile/android/targets/release-android.nix` to `nix/mobile/android/release.nix`

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2020-05-15 16:19:27 +02:00
Jakub Sokołowski ed4d0a1ed9
nix: refactor updating Gradle dependencies
changes:
- Moved Gradle deps setup to `nix/deps/gradle`
- Dropped `nix/mobile/android/maven-and-npm-deps/maven`
- Used GNU Parallel to optimize `nix/deps/gradle/generate.sh`
- Move Maven+Node shell setup from `release-android.nix` to Android shell
- Moved AAPT2 patching to `nix/pkgs/aapt2`
- Drop `patchPhase` and `gradlew` use from `release-android.nix`
- Simplify symlinking `{mobile,desktop}/js_files/*`
- Add new `nodejs` shell and merge it with `clojure` and `gradle`
- Re-created Gradle deps files with new scripts:
  - `nix/deps/gradle/proj.list`
  - `nix/deps/gradle/deps.list`
  - `nix/deps/gradle/deps.urls`
  - `nix/deps/gradle/deps.nix`

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2020-05-14 09:46:30 +02:00
Jakub Sokołowski 954e677f0c
nix: use symlinks for maven dependencies derivation
This should reduce the size of the derivation by >50%.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2020-05-05 20:00:40 +02:00
Jakub Sokołowski 42fb40476c
nix: reafactoring of status-go builds
Changes:
- Fixed `nix/status-go/desktop` builds
- Dropped nimbus wrapper for `status-go` for now
- Split `status-go` builds into subfolders: `mobile`, `desktop`
- Fixed shells for desktop builds: `linux`,`macos`,`windows`
- Added `make status-go-*` targets for building them
- Moved source management to `nix/status-go/source.nix`
- Moved `nix/status-go/build.nix` into `nix/status-go/mobile`
- Moved `nix/desktop/cmake/qtkeychain` to `nix/pkgs/qtkeychain-src`
- Moved `nix/desktop/linux/linuxdeployqt` to `nix/pkgs`
- Moved `nix/desktop/linux/appimagekit` to `nix/pkgs`
- Dropped `nix/tools/mkShell.nix` since it did almost nothing
- Dropped `nix/desktop/cmake/snorenotify` since it's broken
- Moved setup from `nix/tools/mkShell.nix` to `nix/shells.nix`
- Simplified `nix/mobile/ios/status-go-shell.nix`
- Simplified `nix/status-go/default.nix`
- Updated the `nix/DETAILS.md` and `nix/README.md`
- Moved known issues to `nix/KNOWN_ISSUES.md`
- Improved output of `nix/scripts/build.sh`

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2020-05-04 20:55:07 +02:00
yenda d5ef218584
use shadow-cljs
Signed-off-by: Jakub Sokołowski <jakub@status.im>
Signed-off-by: yenda <eric@status.im>
2020-04-30 15:43:46 +02:00
Jakub Sokołowski 7b6b620ceb
nix: use overlays instead of packageOverrides
Changes:
- Add `nix/DETAILS.md` for more in-depth info
- Rename some of `config.status-im` variables
- Drop `env` argument for Android build
- Use `overlays` instead of `packageOverrides`
- Move the `pkgs` overlay to `nix/overlay.nix`
- Move `nix/status-go/utils.nix` to `nix/tools`
- Make `shell.nix` use the `shells.default` only
- Use `default.nix` as target for `nix/scripts/shell.sh`
- Make `nix/scripts/shell.sh` use `--attr` instead of `target`
- Drop the `target` argument in favour of using `--attr`
- Drop unnecessary `src` from `nix/mobile/ios/default.nix`
- Move `mkShell` and `mergeSh` under `lib`
- Move `patched-go` package to `nix/pkgs` directory
- Move `gomobile` package to `nix/pkgs` directory
- Move `ANDROID_ABI_SPLIT` to `config.status-im.android.abi-split`
- Move `ANDROID_ABI_INCLUDE to `config.status-im.android.abi-include`

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2020-04-29 11:53:33 +02:00
Jakub Sokołowski 0cc7ec92bd
fix displaying of version and build number in app
Changes:
- Includes `VERSION` file in source for `jsbundle` derivation
- Includes `BUILD_NUMBER` file and it's generation scripts
- Includes minimal `.git` files to make `git rev-parse --short HEAD` work
- Implements `ignoreVCS` for `mkFilter` to be able to include `.git` files
- Adds missing `git` and `bash` to `buildInputs` for `jsbundle` derivation
- Dropped `bash -c` from Clojure code calling `git`

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2020-04-08 22:55:53 +02:00
Jakub Sokołowski f75cb14588
refactor and simplify mkFilter, use more restrictive rules
This should reduce rebuilds of status-react-npm-gradle-modules

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2020-03-31 17:03:39 +02:00
Pedro Pombeiro d62cda4d66
nix: Add support for reading .env feature flags 2020-01-14 15:16:30 +01:00
Jakub Sokołowski 713850fcb4
fix failure due to superfluous slashes in path
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2019-12-13 13:05:00 +01:00
Jakub Sokołowski aca703a011
major nix refactor
Changes:
- Adds a new `nix-gc` Makefile target for removing old packages
- Moves all `nix/*.sh` files to `nix/scripts/*.sh` to make things more tidy
- Renames `TARGET_OS` into `TARGET` and makes it effective only with `nix/scripts/shell.sh`
- Renames `target-os` Nix argument to just `target` and makes it effective only with `shell.nix`
- Drops `IN_CI_ENVIRONMENT` env variable which was useless
- Drops use of `target-os` argument outside of `shell.nix` (with few exceptions, but just in naming)
- `nix/platform.nix` has been made obsolete and removed
- Moves the definition of all major targets to `nix/targets.nix`
- Moves the definition of all major shells to `nix/shells.nix`
- Makes `default.nix` and `shell.nix` just thin wrappers around `nix/default.nix`
- `nix/nixpkgs-bootstrap.nix` has been moved to `nix/pkgs.nix`
- All package and tool overrides have been moved to `nix/pkgs.nix`
- Explicit passing of contents of `pkgs` has been removed in favor of `callPackage` doing it for us
- `nix/bootstrapped-shell.nix` has been moved to `nix/tools/mkShell.nix`
- A new `mergeSh` tool has been added to `pkgs` from `nix/tools/mergeSh.nix`
  - This tool is used to merge shells created using `mkShell`
- `mobile/targets/jsbundle.nix` has been moved to `mobile/android/jsbundle/default.nix`
- Moves `status-go` version sanitization to `nix/status-go/utils.nix`
- Renames version to rawVersion and versionName to cleanVersion in status-go derivation
- Ports nix/mobile/ios/install-pods-and-status-go.sh to Nix sub-shells
- Moves adjustment of `inotify/max_user_watches` out into `scripts/inotify_fix.sh`
- Makes iOS builds use the Nix version of Fastlane

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2019-12-12 18:51:21 +01:00
Pedro Pombeiro 7e6caf03ad
nix: Use mkFilter in local status-go source
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
2019-11-26 18:34:46 +01:00
Pedro Pombeiro 66b982c3fb
Use react-native net-info community package
Signed-off-by: yenda <eric@status.im>
2019-09-05 14:16:28 +02:00
Jakub Sokołowski 7517f5235a
use nix shell for nix-update-* targets
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2019-07-30 14:11:02 -04:00
Pedro Pombeiro 9594552102
nix: Apply some nixfmt suggestions and fix macOS status-go buildInputs
Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
2019-07-29 18:01:07 +02:00
Pedro Pombeiro a7fd659d84
nix: Wrap gradle, npm packages, `lein prod-build` and `gradle assembleRelease` in Nix expressions to improve reproducible builds with constant build paths 2019-07-15 16:08:02 +02:00