File tree Expand file tree Collapse file tree 16 files changed +145
-21
lines changed
Expand file tree Collapse file tree 16 files changed +145
-21
lines changed Original file line number Diff line number Diff line change 1+ set -a
2+ use flake
Original file line number Diff line number Diff line change 1+ name : main
2+ on :
3+ pull_request :
4+ concurrency :
5+ group : ${{ github.ref }}-${{ github.workflow }}
6+ jobs :
7+ build-linux :
8+ runs-on : ubuntu-22.04
9+ steps :
10+ - uses : actions/checkout@main
11+ - name : build tileconv
12+ run : |
13+ sudo apt-get update -yqqq
14+ sudo apt-get install -yqqq libsquish-dev zlib1g-dev libimagequant0 libjpeg-turbo
15+ make -j$(npoc) -C tileconv
16+ - uses : actions/upload-artifact@v4
17+ with :
18+ name : ubuntu-22.04
19+ path : tileconv/tileconv
20+ if-no-files-found : error
21+ build-nix :
22+ strategy :
23+ matrix :
24+ include :
25+ - os : macos-latest
26+ - os : macos-15-intel
27+ - os : ubuntu-24.04
28+ - os : ubuntu-24.04-arm
29+ runs-on : ${{ matrix.os }}
30+ steps :
31+ - uses : actions/checkout@main
32+ - uses : cachix/install-nix-action@master
33+ with :
34+ nix_path : nixpkgs=channel:nixos-25.11
35+ - run : |
36+ nix-build
Original file line number Diff line number Diff line change 2626/Debug
2727/Release
2828/.settings
29+
30+ .direnv
31+ .envrc
32+ result
Original file line number Diff line number Diff line change 1+ let
2+ nixpkgs_unstable = import ( fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-unstable-small" ) { } ;
3+ in
4+ { pkgs ? nixpkgs_unstable , ... } :
5+ pkgs . stdenv . mkDerivation rec {
6+ name = "tileconv" ;
7+ src = ./tileconv ;
8+ nativeBuildInputs = with pkgs ; [
9+ gnumake
10+ libjpeg8
11+ libsquish
12+ libimagequant
13+ zlib
14+ ] ;
15+ buildInputs = with pkgs ; [
16+ git
17+ ] ;
18+ configurePhase = ''
19+ make clean
20+ mkdir -p $out/bin
21+ '' ;
22+ buildPhase = ''
23+ make -j$(nproc) all
24+ cp tileconv $out/bin/tileconv
25+ '' ;
26+ installPhase = ''
27+ ls $out
28+ '' ;
29+ enableParallelBuilding = true ;
30+ }
Original file line number Diff line number Diff line change 1+ {
2+ inputs = {
3+ nixpkgs . url = "github:NixOS/nixpkgs/nixos-unstable-small" ;
4+ } ;
5+ outputs = { self , nixpkgs } :
6+ let
7+ systems = [
8+ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"
9+ ] ;
10+ forEachSystem = f : nixpkgs . lib . genAttrs systems ( system : f system ) ;
11+ pkgsFor = nixpkgs . legacyPackages ;
12+ in {
13+ devShells = forEachSystem ( system :
14+ let
15+ pkgs = import nixpkgs { inherit system ; } ;
16+ in {
17+ default = pkgs . stdenv . mkDerivation {
18+ name = "tileconv" ;
19+ src = ./tileconv ;
20+ # Libs
21+ buildInputs = with pkgs ; [
22+ gnumake
23+ libjpeg8
24+ libsquish
25+ libimagequant
26+ zlib
27+ ] ;
28+ # Tools
29+ nativeBuildInputs = with pkgs ; [
30+ direnv
31+ git
32+ ] ;
33+ # Env
34+ shellHook = ''
35+ '' ;
36+ } ;
37+ } ) ;
38+ packages = forEachSystem ( system : {
39+ default = pkgsFor . ${ system } . callPackage ./default.nix { pkgs = import nixpkgs { inherit system ; } ; } ;
40+ } ) ;
41+ } ;
42+ }
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ include config.mk
66
77CXX ?= g++
88CXXFLAGS = -c -Wall -O2 -std=c++11 -msse -mfpmath=sse -I$(ZLIB_INCLUDE ) -I$(PNGQUANT_INCLUDE ) -I$(SQUISH_INCLUDE ) -I$(JPEG_INCLUDE )
9- LDFLAGS = -L$(ZLIB_LIB ) -L$(PNGQUANT_LIB ) -L$(SQUISH_LIB ) -L$(JPEG_LIB )
109LIBS = -lz -limagequant -lsquish -ljpeg
1110EXECUTABLE = tileconv
1211
@@ -78,5 +77,4 @@ $(EXECUTABLE): $(OBJECTS)
7877 $(CXX ) $(CPPFLAGS ) $(CXXFLAGS ) $< -o $@
7978
8079clean :
81- $(RM ) $(OBJECTS )
82- # $(RM) *.o
80+ $(RM ) -f * .o
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ THE SOFTWARE.
2222#ifndef _COLORQUANT_H_
2323#define _COLORQUANT_H_
2424
25- #include < lib/ libimagequant.h>
25+ #include < libimagequant.h>
2626
2727namespace tc {
2828
Original file line number Diff line number Diff line change 11# Where to install (Linux/Mac only)
22INSTALL_DIR ?= /usr/local
33
4- # Include paths of the external libraries
5- ZLIB_INCLUDE ?= ./zlib
6- SQUISH_INCLUDE ?= ./squish
7- PNGQUANT_INCLUDE ?= ./pngquant
8- JPEG_INCLUDE ?= ./jpeg-turbo
9-
10- # Paths to the libraries
11- ZLIB_LIB ?= ./zlib
12- SQUISH_LIB ?= ./squish
13- PNGQUANT_LIB ?= ./pngquant/lib
14- JPEG_LIB ?= ./jpeg-turbo
15-
164# Set to 1 when compiling on Windows using Win32 threads
175USE_WINTHREADS ?= 0
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments