Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/buildAndCache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
strategy:
matrix:
os:
- ubuntu-latest # x86_64-linux
- macos-13 # x86_64-darwin
- macos-latest # aarch64-darwin
- ubuntu-latest # x86_64-linux
- macos-15-intel # x86_64-darwin
- macos-latest # aarch64-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -22,8 +22,8 @@ jobs:
name: pebble
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'

- name: Build pebble-tool
run: nix build -L .#pebble-tool
# - name: Build pebble-tool
# run: nix build -L .#pebble-tool

- name: Build Core Devices pebble-tool
run: nix build -L .#coredevices.pebble-tool
Expand All @@ -34,9 +34,9 @@ jobs:
- name: Build pebble-toolchain-bin
run: nix build -L .#pebble-toolchain-bin

- name: Build arm-embedded-toolchain
if: ${{ matrix.os != 'macos-latest' }}
run: nix build -L .#arm-embedded-toolchain
# - name: Build arm-embedded-toolchain
# if: ${{ matrix.os != 'macos-latest' }}
# run: nix build -L .#arm-embedded-toolchain

- name: Build pebbleEnv
run: nix shell -f default.nix pebbleEnv --command sh -c "echo OK"
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ Development shells can be configured by specifying the following arguments to `p
- `cloudPebble`: Whether to connect via a CloudPebble connection. Requires logging into Rebble via `pebble login`.
- `packages`: Any extra tools to use during development.
- `CFLAGS`: Extra flags to pass to the compiler during app builds.
- `withCoreDevices`: Whether to use Core Devices' new pebble-tool, updated to work with Python 3. Defaults to `false`.
- `withCoreDevices`: Whether to use Core Devices' new pebble-tool, updated to work with Python 3. Defaults to `true`.
- **NOTE:** Currently, setting this to `false` is broken, and not supported. The option will likely be removed in a future update to pebble.nix, due to [nixpkgs working on removing support for Python 2](https://github.com/NixOS/nixpkgs/issues/479927).

### App Store Builds

Expand Down
23 changes: 11 additions & 12 deletions buildTools/pebbleEnv.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
mkShell,
mkShellNoCC,
lib,
coredevices,
nodejs,
Expand All @@ -15,7 +15,7 @@
nativeBuildInputs ? [ ],
packages ? [ ],
CFLAGS ? "",
withCoreDevices ? false,
withCoreDevices ? true,
...
}@attrs:

Expand All @@ -32,18 +32,17 @@ let

pebbleToolPackage = if withCoreDevices then coredevices.pebble-tool else pebble-tool;
in
mkShell (
mkShellNoCC (
{
name = "pebble-env";
packages =
[
nodejs
pebble-qemu
pebbleToolPackage
pebble-toolchain-bin
]
++ packages
++ nativeBuildInputs;
packages = [
nodejs
pebble-qemu
pebbleToolPackage
pebble-toolchain-bin
]
++ packages
++ nativeBuildInputs;

env = {
inherit CFLAGS;
Expand Down
17 changes: 10 additions & 7 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
let
system = builtins.currentSystem;

flakeLock = builtins.fromJSON (builtins.readFile ./flake.lock);
lockFile = builtins.fromJSON (builtins.readFile ./flake.lock);
flake-compat-node = lockFile.nodes.${lockFile.nodes.root.inputs.flake-compat};
flake-compat = builtins.fetchTarball {
inherit (flake-compat-node.locked) url;
sha256 = flake-compat-node.locked.narHash;
};

flake =
(import (fetchTarball {
url =
flakeLock.nodes.flake-compat.locked.url
or "https://github.com/edolstra/flake-compat/archive/${flakeLock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = flakeLock.nodes.flake-compat.locked.narHash;
}) { src = ./.; }).defaultNix.outputs;
(import flake-compat {
src = ./.;
}).defaultNix;
in
{
buildPebbleApp = flake.buildPebbleApp.${system};
Expand Down
15 changes: 8 additions & 7 deletions derivations/arm-embedded-toolchain/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,12 @@ gccStdenv.mkDerivation rec {
texinfo
];

buildInputs =
[
ncurses
]
++ lib.optionals gccStdenv.isDarwin [
libiconv
];
buildInputs = [
ncurses
]
++ lib.optionals gccStdenv.isDarwin [
libiconv
];

postUnpack = ''
# Extract all tarballs in the source directory
Expand Down Expand Up @@ -101,5 +100,7 @@ gccStdenv.mkDerivation rec {
mainProgram = "arm-none-eabi-gcc";
platforms = platforms.linux ++ platforms.darwin;
badPlatforms = [ "aarch64-darwin" ];
# no idea, don't care about this enough to make it work again
broken = true;
};
}
34 changes: 13 additions & 21 deletions derivations/coredevices/pebble-tool.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
fetchFromGitHub,
makeWrapper,
coredevices,
freetype,
nodejs,
python3Packages,
zlib,
}:

let
rpath = lib.makeLibraryPath [
freetype
zlib
];

Expand All @@ -25,43 +23,35 @@ let
tag = version;
hash = "sha256-xVVBtwYPAsScYitINnKhj3XOgapXzQnXvmuF0B4Kuac=";
};
};

libpebble2 = python3Packages.buildPythonPackage {
pname = "libpebble2";
version = "0.0.28";
src = fetchFromGitHub {
owner = "pebble-dev";
repo = "libpebble2";
rev = "575fe2cfae39e1a1c61937d4e90628a3d5790a4d";
hash = "sha256-bQNeJoiQhg/twMcYpgvBOG/mutm3Fuf9iwF0y5UgWs0=";
};
postPatch = ''
rm Makefile
'';

propagatedBuildInputs = with python3Packages; [
pyserial
six
websocket_client
];
pyproject = true;
build-system = [ python3Packages.setuptools ];
};
in
python3Packages.buildPythonPackage rec {
pname = "pebble-tool";
version = "5.0.5";
version = "5.0.21";

src = fetchFromGitHub {
owner = "coredevices";
repo = "pebble-tool";
tag = "v${version}";
hash = "sha256-z0sZGQoMZLVYUP1ZC40TfuSj0P0QE0i/V1Jy+lM2sA4=";
hash = "sha256-hF4G6NUXZtWG8qZ10pMd4QeIvqCjmxFcuH4a3xR1NrQ=";
};

nativeBuildInputs = [ makeWrapper ];

buildInputs = [ nodejs ];

propagatedBuildInputs = with python3Packages; [
cobs
coredevices.pypkjs
colorama
freetype-py
httplib2
libpebble2
oauth2client
Expand All @@ -77,11 +67,13 @@ python3Packages.buildPythonPackage rec {
six
sourcemap
websocket-client
websockify
wheel

freetype
];

pyproject = true;
build-system = [ python3Packages.hatchling ];

postFixup = ''
wrapProgram $out/bin/pebble \
--prefix PATH : ${lib.makeBinPath [ nodejs ]} \
Expand Down
24 changes: 18 additions & 6 deletions derivations/coredevices/pypkjs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ let
}).${stdenv.hostPlatform.system};
hash =
({
x86_64-linux = "sha256-wkqkIVxk231n/GxCwNdzHKvPMAWWv5yCaudPQm/jt3E=";
x86_64-darwin = "sha256-/CuVa/ryNTHEkIRe232A/JmP6K7hx88TNzF9rgEWkwc=";
aarch64-darwin = "sha256-bcQLZWzqf+VB9r262DtrTtUeXq2YW1TBOTGacxJTpV4=";
x86_64-linux = "sha256-g0uXYbt/SdqLiHhHx2R0laLPbEX2niEkrg4/AkSTvBU=";
x86_64-darwin = "sha256-tT32EUqIaY7m84IM9GR26D7gnJpn3Z989YymopKCOLA=";
aarch64-darwin = "sha256-bLXodRruJIfMO18h6sbUWQQacYCneZQbZNtXNuJydu4=";
}).${stdenv.hostPlatform.system};
};

Expand All @@ -43,7 +43,8 @@ let
nativeBuildInputs = [
python3Packages.pypaInstallHook
python3Packages.wheelUnpackHook
] ++ (lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook);
]
++ (lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook);

buildInputs = [ zlib ];
};
Expand All @@ -58,6 +59,13 @@ let
tag = "v${version}";
hash = "sha256-D058c3o+2rTMQJpgwvFKd5Qwt2j7u4+GFpQHjO7lOVQ=";
};

postPatch = ''
rm Makefile
'';

pyproject = true;
build-system = [ python3Packages.setuptools ];
};
in
python3Packages.buildPythonPackage rec {
Expand All @@ -77,18 +85,22 @@ python3Packages.buildPythonPackage rec {
gevent
gevent-websocket
greenlet
libpebble2
netaddr
peewee
pygeoip
pypng
python-dateutil
stpyv8
dateutil
requests
sh
six
websocket_client
websocket-client
];

pyproject = true;
build-system = [ python3Packages.setuptools ];

postFixup = ''
wrapProgram $out/bin/pypkjs \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ stdenv.cc.cc.lib ]}
Expand Down
28 changes: 28 additions & 0 deletions derivations/libpebble2.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
buildPythonPackage,
fetchFromGitHub,
pyserial,
setuptools,
six,
websocket-client,
}:

buildPythonPackage rec {
pname = "libpebble2";
version = "0.0.30";
src = fetchFromGitHub {
owner = "pebble-dev";
repo = "libpebble2";
tag = "v${version}";
hash = "sha256-jzN3bMp7hCCFP6wQ4woXTgOmehczvn7cLqen9TlG7Dc=";
};

propagatedBuildInputs = [
pyserial
six
websocket-client
];

pyproject = true;
build-system = [ setuptools ];
}
13 changes: 8 additions & 5 deletions derivations/pebble-qemu.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
flex,
glib,
libtool,
libx11,
perl,
pixman,
pkg-config,
Expand All @@ -31,13 +32,13 @@ let
in
stdenv.mkDerivation {
name = "pebble-qemu";
version = "2.5.0-pebble6";
version = "2.5.0-pebble8";

src = fetchFromGitHub {
owner = "pebble-dev";
owner = "coredevices";
repo = "qemu";
rev = "615110afaf9fd48435263a340e0ceccfe2d52997";
hash = "sha256-tblgseY4g/5Hyor3dvGILGw5ECgtfDoyjkRcQrTVr24=";
rev = "a0da0db291d92d491b4883cec01ba8f088ef5b3b";
hash = "sha256-DVep6uwHw/1oyzHLYmWQPu6taD2bRkmcq/pA6PsY2Fc=";
fetchSubmodules = true;
};

Expand All @@ -54,10 +55,12 @@ stdenv.mkDerivation {

buildInputs = [
glib
libx11
pixman
SDL2
zlib
] ++ darwinDeps;
]
++ darwinDeps;

configureFlags = [
"--with-coroutine=gthread"
Expand Down
5 changes: 3 additions & 2 deletions derivations/pebble-tool/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ python2Packages.buildPythonPackage {
propagatedBuildInputs =
builtins.attrValues pythonLibs
++ (with python2Packages; [
enum34
httplib2
packaging
pyqrcode
pyserial

Expand Down Expand Up @@ -83,5 +81,8 @@ python2Packages.buildPythonPackage {
license = licenses.mit;
mainProgram = "pebble";
platforms = platforms.linux ++ platforms.darwin;
# Nixpkgs has neutered it's Python 2 packaging to the point where it's really tricky to make it work for this
# anymore.
broken = true;
};
}
Loading