mirror of
				https://github.com/nkanaev/yarr.git
				synced 2025-10-31 06:53:30 +00:00 
			
		
		
		
	Compare commits
	
		
			20 Commits
		
	
	
		
			gh-actions
			...
			5bf7647cba
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 5bf7647cba | ||
|  | f721034ae5 | ||
|  | a32361fab2 | ||
|  | 572e489db6 | ||
|  | efcb6f8bf0 | ||
|  | 7e367ef537 | ||
|  | b9a3326a98 | ||
|  | 484b155a3c | ||
|  | 9cba4e8deb | ||
|  | 749d7b682e | ||
|  | 35850d6310 | ||
|  | 15db17d834 | ||
|  | a0d86e884a | ||
|  | acf97c8a3b | ||
|  | 34bf9e5160 | ||
|  | 4420f3a8ae | ||
|  | 8d2ea6cf8a | ||
|  | e244237474 | ||
|  | ff81c9d689 | ||
|  | 11d99f106e | 
							
								
								
									
										25
									
								
								.github/actions/prepare/action.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								.github/actions/prepare/action.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,25 @@ | |||||||
|  | name: Build & Upload | ||||||
|  | inputs: | ||||||
|  |   id: | ||||||
|  |     description: artifact name | ||||||
|  |     required: true | ||||||
|  |   cmd: | ||||||
|  |     description: command to run | ||||||
|  |     required: true | ||||||
|  |   out: | ||||||
|  |     description: path to output file | ||||||
|  |     required: true | ||||||
|  | runs: | ||||||
|  |   using: composite | ||||||
|  |   steps: | ||||||
|  |     - name: compile | ||||||
|  |       run: ${{ inputs.cmd }} | ||||||
|  |       shell: bash | ||||||
|  |     - name: archive | ||||||
|  |       run: tar -cvf ${{ inputs.out }}.tar ${{ inputs.out }} | ||||||
|  |       shell: bash | ||||||
|  |     - name: upload | ||||||
|  |       uses: actions/upload-artifact@v4 | ||||||
|  |       with: | ||||||
|  |         name: ${{ inputs.id }} | ||||||
|  |         path: ${{ inputs.out }}.tar | ||||||
							
								
								
									
										229
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										229
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							| @@ -5,169 +5,121 @@ on: | |||||||
|     tags: |     tags: | ||||||
|       - v* |       - v* | ||||||
|   workflow_dispatch: |   workflow_dispatch: | ||||||
|   workflow_run: |  | ||||||
|     workflows: [Test] |  | ||||||
|     types: |  | ||||||
|       - completed |  | ||||||
|  |  | ||||||
| jobs: | jobs: | ||||||
|   build_macos: |   build_macos: | ||||||
|     name: Build for MacOS |     name: Build for MacOS | ||||||
|     runs-on: macos-13 |     runs-on: macos-13 | ||||||
|     steps: |     steps: | ||||||
|     - name: "Checkout" |     - name: Checkout | ||||||
|       uses: actions/checkout@v2 |       uses: actions/checkout@v4 | ||||||
|  |     - name: Setup Go | ||||||
|  |       uses: actions/setup-go@v4 | ||||||
|       with: |       with: | ||||||
|         submodules: 'recursive' |         go-version: '^1.18' | ||||||
|     - name: "Setup Go" |     - name: Build arm64 gui | ||||||
|       uses: actions/setup-go@v2 |       uses: ./.github/actions/prepare | ||||||
|       with: |       with: | ||||||
|         go-version: '^1.17' |         id: darwin_arm64_gui | ||||||
|     - name: Cache Go Modules |         cmd: make darwin_arm64_gui | ||||||
|       uses: actions/cache@v4 |         out: out/darwin_arm64_gui/yarr.app | ||||||
|  |     - name: Build amd64 gui | ||||||
|  |       uses: ./.github/actions/prepare | ||||||
|       with: |       with: | ||||||
|         path: ~/go/pkg/mod |         id: darwin_amd64_gui | ||||||
|         key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} |         cmd: make darwin_amd64_gui | ||||||
|         restore-keys: | |         out: out/darwin_amd64_gui/yarr.app | ||||||
|           ${{ runner.os }}-go- |     - name: Build arm64 | ||||||
|     - name: "Build" |       uses: ./.github/actions/prepare | ||||||
|       run: make build_macos |  | ||||||
|     - name: Upload |  | ||||||
|       uses: actions/upload-artifact@v4 |  | ||||||
|       with: |       with: | ||||||
|         name: macos |         id: darwin_arm64 | ||||||
|         path: _output/macos/yarr.app |         cmd: make darwin_arm64 | ||||||
|  |         out: out/darwin_arm64/yarr | ||||||
|  |     - name: Build amd64 | ||||||
|  |       uses: ./.github/actions/prepare | ||||||
|  |       with: | ||||||
|  |         id: darwin_amd64 | ||||||
|  |         cmd: make darwin_amd64 | ||||||
|  |         out: out/darwin_amd64/yarr | ||||||
|  |  | ||||||
|   build_windows: |   build_windows: | ||||||
|     name: Build for Windows |     name: Build for Windows | ||||||
|     runs-on: windows-2022 |     runs-on: windows-2022 | ||||||
|     steps: |     steps: | ||||||
|     - name: "Checkout" |     - name: Checkout | ||||||
|       uses: actions/checkout@v2 |       uses: actions/checkout@v4 | ||||||
|  |     - name: Setup Go | ||||||
|  |       uses: actions/setup-go@v4 | ||||||
|       with: |       with: | ||||||
|         submodules: 'recursive' |         go-version: '^1.18' | ||||||
|     - name: "Setup Go" |     - name: Setup Zig | ||||||
|       uses: actions/setup-go@v2 |       uses: mlugg/setup-zig@v1 | ||||||
|       with: |       with: | ||||||
|         go-version: '^1.17' |         version: 0.14.0 | ||||||
|     - name: Cache Go Modules |     - name: Build arm64 gui | ||||||
|       uses: actions/cache@v4 |       if: false | ||||||
|  |       uses: ./.github/actions/prepare | ||||||
|       with: |       with: | ||||||
|         path: ~/go/pkg/mod |         id: windows_arm64_gui | ||||||
|         key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} |         cmd: make windows_arm64_gui | ||||||
|         restore-keys: | |         out: out/windows_arm64_gui/yarr.app | ||||||
|           ${{ runner.os }}-go- |     - name: Build amd64 gui | ||||||
|     - name: "Build" |       uses: ./.github/actions/prepare | ||||||
|       run: make build_windows |  | ||||||
|     - name: Upload |  | ||||||
|       uses: actions/upload-artifact@v4 |  | ||||||
|       with: |       with: | ||||||
|         name: windows |         id: windows_amd64_gui | ||||||
|         path: _output/windows/yarr.exe |         cmd: make windows_amd64_gui | ||||||
|  |         out: out/windows_amd64_gui/yarr.app | ||||||
|  |     - name: Build arm64 | ||||||
|  |       uses: ./.github/actions/prepare | ||||||
|  |       with: | ||||||
|  |         id: windows_arm64 | ||||||
|  |         cmd: make windows_arm64 | ||||||
|  |         out: out/windows_arm64/yarr | ||||||
|  |     - name: Build amd64 | ||||||
|  |       uses: ./.github/actions/prepare | ||||||
|  |       with: | ||||||
|  |         id: windows_amd64 | ||||||
|  |         cmd: make windows_amd64 | ||||||
|  |         out: out/windows_amd64/yarr | ||||||
|  |  | ||||||
|   build_linux: |   build_linux: | ||||||
|     name: Build for Linux |     name: Build for Linux | ||||||
|     runs-on: ubuntu-22.04 |     runs-on: ubuntu-22.04 | ||||||
|     steps: |     steps: | ||||||
|     - name: "Checkout" |     - name: Checkout | ||||||
|       uses: actions/checkout@v2 |       uses: actions/checkout@v4 | ||||||
|  |     - name: Setup Go | ||||||
|  |       uses: actions/setup-go@v4 | ||||||
|       with: |       with: | ||||||
|         submodules: 'recursive' |         go-version: '^1.18' | ||||||
|     - name: "Setup Go" |     - name: Setup Zig | ||||||
|       uses: actions/setup-go@v2 |       uses: mlugg/setup-zig@v1 | ||||||
|       with: |       with: | ||||||
|         go-version: '^1.17' |         version: 0.14.0 | ||||||
|     - name: Cache Go Modules |     - name: Build amd64 | ||||||
|       uses: actions/cache@v4 |       uses: ./.github/actions/prepare | ||||||
|       with: |       with: | ||||||
|         path: ~/go/pkg/mod |         id: linux_amd64 | ||||||
|         key: ${{ runner.os }}-amd64-go-${{ hashFiles('**/go.sum') }} |         cmd: make linux_amd64 | ||||||
|         restore-keys: | |         out: out/linux_amd64/yarr | ||||||
|           ${{ runner.os }}-go-amd64 |     - name: Build arm64 | ||||||
|     - name: "Build" |       uses: ./.github/actions/prepare | ||||||
|       run: make build_linux |  | ||||||
|     - name: Upload |  | ||||||
|       uses: actions/upload-artifact@v4 |  | ||||||
|       with: |       with: | ||||||
|         name: linux |         id: linux_arm64 | ||||||
|         path: _output/linux/yarr |         cmd: make linux_arm64 | ||||||
|  |         out: out/linux_arm64/yarr | ||||||
|   build_linux-arm: |     - name: Build armv7 | ||||||
|     name: Build for Linux ARM |       uses: ./.github/actions/prepare | ||||||
|     runs-on: ubuntu-22.04 |  | ||||||
|     steps: |  | ||||||
|     - name: Install dependencies |  | ||||||
|       run: > |  | ||||||
|         sudo apt-get install -y |  | ||||||
|         gcc-arm-linux-gnueabihf |  | ||||||
|         libc6-dev-armhf-cross |  | ||||||
|     - name: "Checkout" |  | ||||||
|       uses: actions/checkout@v2 |  | ||||||
|       with: |       with: | ||||||
|         submodules: 'recursive' |         id: linux_armv7 | ||||||
|     - name: "Setup Go" |         cmd: make linux_armv7 | ||||||
|       uses: actions/setup-go@v2 |         out: out/linux_armv7/yarr | ||||||
|       with: |  | ||||||
|         go-version: '^1.17' |  | ||||||
|     - name: Cache Go Modules |  | ||||||
|       uses: actions/cache@v4 |  | ||||||
|       with: |  | ||||||
|         path: ~/go/pkg/mod |  | ||||||
|         key: ${{ runner.os }}-armv7-go-${{ hashFiles('**/go.sum') }} |  | ||||||
|         restore-keys: | |  | ||||||
|           ${{ runner.os }}-go-armv7 |  | ||||||
|     - name: "Build" |  | ||||||
|       env: |  | ||||||
|         CC: arm-linux-gnueabihf-gcc |  | ||||||
|         GOARCH: arm |  | ||||||
|         GOARM: 7 |  | ||||||
|       run: make build_linux |  | ||||||
|     - name: Upload |  | ||||||
|       uses: actions/upload-artifact@v4 |  | ||||||
|       with: |  | ||||||
|         name: linux_arm |  | ||||||
|         path: _output/linux/yarr |  | ||||||
|  |  | ||||||
|   build_linux-arm64: |  | ||||||
|     name: Build for Linux ARM64 |  | ||||||
|     runs-on: ubuntu-22.04 |  | ||||||
|     steps: |  | ||||||
|     - name: Install dependencies |  | ||||||
|       run: > |  | ||||||
|         sudo apt-get install -y |  | ||||||
|         gcc-aarch64-linux-gnu |  | ||||||
|         libc6-dev-arm64-cross |  | ||||||
|     - name: "Checkout" |  | ||||||
|       uses: actions/checkout@v2 |  | ||||||
|       with: |  | ||||||
|         submodules: 'recursive' |  | ||||||
|     - name: "Setup Go" |  | ||||||
|       uses: actions/setup-go@v2 |  | ||||||
|       with: |  | ||||||
|         go-version: '^1.17' |  | ||||||
|     - name: Cache Go Modules |  | ||||||
|       uses: actions/cache@v4 |  | ||||||
|       with: |  | ||||||
|         path: ~/go/pkg/mod |  | ||||||
|         key: ${{ runner.os }}-arm64-go-${{ hashFiles('**/go.sum') }} |  | ||||||
|         restore-keys: | |  | ||||||
|           ${{ runner.os }}-go-arm64 |  | ||||||
|     - name: "Build" |  | ||||||
|       env: |  | ||||||
|         CC: aarch64-linux-gnu-gcc |  | ||||||
|         GOARCH: arm64 |  | ||||||
|       run: make build_linux |  | ||||||
|     - name: Upload |  | ||||||
|       uses: actions/upload-artifact@v4 |  | ||||||
|       with: |  | ||||||
|         name: linux_arm64 |  | ||||||
|         path: _output/linux/yarr |  | ||||||
|  |  | ||||||
|   create_release: |   create_release: | ||||||
|     name: Create Release |     name: Create Release | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|     if: ${{ startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'test') }} |     if: ${{ startsWith(github.ref, 'refs/tags/') }} | ||||||
|     needs: [build_macos, build_windows, build_linux, build_linux-arm, build_linux-arm64] |     needs: [build_macos, build_windows, build_linux] | ||||||
|     steps: |     steps: | ||||||
|     - name: Download Artifacts |     - name: Download Artifacts | ||||||
|       uses: actions/download-artifact@v4.1.7 |       uses: actions/download-artifact@v4.1.7 | ||||||
| @@ -176,17 +128,8 @@ jobs: | |||||||
|     - name: Preparation |     - name: Preparation | ||||||
|       run: | |       run: | | ||||||
|         ls -R |         ls -R | ||||||
|         chmod u+x macos/Contents/MacOS/yarr |  | ||||||
|         chmod u+x linux/yarr |  | ||||||
|         chmod u+x linux_arm/yarr |  | ||||||
|         chmod u+x linux_arm64/yarr |  | ||||||
|  |  | ||||||
|         mv macos yarr.app && zip -r yarr-${GITHUB_REF_NAME}-macos64.zip yarr.app |  | ||||||
|         ( cd windows        && zip ../yarr-${GITHUB_REF_NAME}-windows64.zip yarr.exe ) |  | ||||||
|         ( cd linux          && zip ../yarr-${GITHUB_REF_NAME}-linux64.zip yarr ) |  | ||||||
|         ( cd linux_arm      && zip ../yarr-${GITHUB_REF_NAME}-linux_arm.zip yarr ) |  | ||||||
|         ( cd linux_arm64    && zip ../yarr-${GITHUB_REF_NAME}-linux_arm64.zip yarr ) |  | ||||||
|     - name: Upload Release |     - name: Upload Release | ||||||
|  |       if: false | ||||||
|       uses: softprops/action-gh-release@v2 |       uses: softprops/action-gh-release@v2 | ||||||
|       env: |       env: | ||||||
|         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||
| @@ -194,8 +137,4 @@ jobs: | |||||||
|           draft: true |           draft: true | ||||||
|           prerelease: true |           prerelease: true | ||||||
|           files: | |           files: | | ||||||
|             yarr-${{ github.ref_name }}-macos64.zip |             *.zip | ||||||
|             yarr-${{ github.ref_name }}-windows64.zip |  | ||||||
|             yarr-${{ github.ref_name }}-linux64.zip |  | ||||||
|             yarr-${{ github.ref_name }}-linux_arm.zip |  | ||||||
|             yarr-${{ github.ref_name }}-linux_arm64.zip |  | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							| @@ -8,7 +8,7 @@ jobs: | |||||||
|  |  | ||||||
|     steps: |     steps: | ||||||
|     - name: Checkout code |     - name: Checkout code | ||||||
|       uses: actions/checkout@v3 |       uses: actions/checkout@v4 | ||||||
|  |  | ||||||
|     - name: Set up Go |     - name: Set up Go | ||||||
|       uses: actions/setup-go@v4 |       uses: actions/setup-go@v4 | ||||||
|   | |||||||
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -1,4 +1,5 @@ | |||||||
| /_output | /_output | ||||||
|  | /out | ||||||
| /yarr | /yarr | ||||||
| *.db | *.db | ||||||
| *.db-shm | *.db-shm | ||||||
|   | |||||||
| @@ -1,48 +0,0 @@ | |||||||
| package main |  | ||||||
|  |  | ||||||
| import ( |  | ||||||
| 	"flag" |  | ||||||
| 	"io/ioutil" |  | ||||||
| 	"strings" |  | ||||||
| ) |  | ||||||
|  |  | ||||||
| var rsrc = `1 VERSIONINFO |  | ||||||
| FILEVERSION     {VERSION_COMMA},0,0 |  | ||||||
| PRODUCTVERSION  {VERSION_COMMA},0,0 |  | ||||||
| BEGIN |  | ||||||
|   BLOCK "StringFileInfo" |  | ||||||
|   BEGIN |  | ||||||
|     BLOCK "080904E4" |  | ||||||
|     BEGIN |  | ||||||
|       VALUE "CompanyName", "Old MacDonald's Farm" |  | ||||||
|       VALUE "FileDescription", "Yet another RSS reader" |  | ||||||
|       VALUE "FileVersion", "{VERSION}" |  | ||||||
|       VALUE "InternalName", "yarr" |  | ||||||
|       VALUE "LegalCopyright", "nkanaev" |  | ||||||
|       VALUE "OriginalFilename", "yarr.exe" |  | ||||||
|       VALUE "ProductName", "yarr" |  | ||||||
|       VALUE "ProductVersion", "{VERSION}" |  | ||||||
|     END |  | ||||||
|   END |  | ||||||
|   BLOCK "VarFileInfo" |  | ||||||
|   BEGIN |  | ||||||
|     VALUE "Translation", 0x809, 1252 |  | ||||||
|   END |  | ||||||
| END |  | ||||||
|  |  | ||||||
| 1 ICON "icon.ico" |  | ||||||
| ` |  | ||||||
|  |  | ||||||
| func main() { |  | ||||||
| 	var version, outfile string |  | ||||||
| 	flag.StringVar(&version, "version", "0.0", "") |  | ||||||
| 	flag.StringVar(&outfile, "outfile", "versioninfo.rc", "") |  | ||||||
| 	flag.Parse() |  | ||||||
|  |  | ||||||
| 	version_comma := strings.ReplaceAll(version, ".", ",") |  | ||||||
|  |  | ||||||
| 	out := strings.ReplaceAll(rsrc, "{VERSION}", version) |  | ||||||
| 	out = strings.ReplaceAll(out, "{VERSION_COMMA}", version_comma) |  | ||||||
|  |  | ||||||
| 	ioutil.WriteFile(outfile, []byte(out), 0644) |  | ||||||
| } |  | ||||||
| @@ -1,99 +0,0 @@ | |||||||
| package main |  | ||||||
|  |  | ||||||
| import ( |  | ||||||
| 	"flag" |  | ||||||
| 	"fmt" |  | ||||||
| 	"io/ioutil" |  | ||||||
| 	"log" |  | ||||||
| 	"os" |  | ||||||
| 	"os/exec" |  | ||||||
| 	"path" |  | ||||||
| 	"strconv" |  | ||||||
| 	"strings" |  | ||||||
| ) |  | ||||||
|  |  | ||||||
| var plist = `<?xml version="1.0" encoding="UTF-8"?> |  | ||||||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |  | ||||||
| <plist version="1.0"> |  | ||||||
| <dict> |  | ||||||
| 	<key>CFBundleName</key> |  | ||||||
| 	<string>yarr</string> |  | ||||||
| 	<key>CFBundleDisplayName</key> |  | ||||||
| 	<string>yarr</string> |  | ||||||
| 	<key>CFBundleIdentifier</key> |  | ||||||
| 	<string>nkanaev.yarr</string> |  | ||||||
| 	<key>CFBundleVersion</key> |  | ||||||
| 	<string>VERSION</string> |  | ||||||
| 	<key>CFBundlePackageType</key> |  | ||||||
| 	<string>APPL</string> |  | ||||||
| 	<key>CFBundleExecutable</key> |  | ||||||
| 	<string>yarr</string> |  | ||||||
|  |  | ||||||
| 	<key>CFBundleIconFile</key> |  | ||||||
| 	<string>icon</string> |  | ||||||
| 	<key>LSApplicationCategoryType</key> |  | ||||||
| 	<string>public.app-category.news</string> |  | ||||||
|  |  | ||||||
| 	<key>NSHighResolutionCapable</key> |  | ||||||
| 	<string>True</string> |  | ||||||
|  |  | ||||||
| 	<key>LSMinimumSystemVersion</key> |  | ||||||
| 	<string>10.13</string> |  | ||||||
| 	<key>LSUIElement</key> |  | ||||||
| 	<true/> |  | ||||||
| 	<key>NSHumanReadableCopyright</key> |  | ||||||
| 	<string>Copyright © 2020 nkanaev. All rights reserved.</string> |  | ||||||
| </dict> |  | ||||||
| </plist> |  | ||||||
| ` |  | ||||||
|  |  | ||||||
| func run(cmd ...string) { |  | ||||||
| 	fmt.Println(cmd) |  | ||||||
| 	err := exec.Command(cmd[0], cmd[1:]...).Run() |  | ||||||
| 	if err != nil { |  | ||||||
| 		log.Fatal(err) |  | ||||||
| 	} |  | ||||||
| } |  | ||||||
|  |  | ||||||
| func main() { |  | ||||||
| 	var version, outdir string |  | ||||||
| 	flag.StringVar(&version, "version", "0.0", "") |  | ||||||
| 	flag.StringVar(&outdir, "outdir", "", "") |  | ||||||
| 	flag.Parse() |  | ||||||
|  |  | ||||||
| 	outfile := "yarr" |  | ||||||
|  |  | ||||||
| 	binDir := path.Join(outdir, "yarr.app", "Contents/MacOS") |  | ||||||
| 	resDir := path.Join(outdir, "yarr.app", "Contents/Resources") |  | ||||||
|  |  | ||||||
| 	plistFile := path.Join(outdir, "yarr.app", "Contents/Info.plist") |  | ||||||
| 	pkginfoFile := path.Join(outdir, "yarr.app", "Contents/PkgInfo") |  | ||||||
|  |  | ||||||
| 	os.MkdirAll(binDir, 0700) |  | ||||||
| 	os.MkdirAll(resDir, 0700) |  | ||||||
|  |  | ||||||
| 	f, _ := ioutil.ReadFile(path.Join(outdir, outfile)) |  | ||||||
| 	ioutil.WriteFile(path.Join(binDir, outfile), f, 0755) |  | ||||||
|  |  | ||||||
| 	ioutil.WriteFile(plistFile, []byte(strings.Replace(plist, "VERSION", version, 1)), 0644) |  | ||||||
| 	ioutil.WriteFile(pkginfoFile, []byte("APPL????"), 0644) |  | ||||||
|  |  | ||||||
| 	iconFile := path.Join(outdir, "icon.png") |  | ||||||
| 	iconsetDir := path.Join(outdir, "icon.iconset") |  | ||||||
| 	os.Mkdir(iconsetDir, 0700) |  | ||||||
|  |  | ||||||
| 	for _, res := range []int{1024, 512, 256, 128, 64, 32, 16} { |  | ||||||
| 		outfile := fmt.Sprintf("icon_%dx%d.png", res, res) |  | ||||||
| 		if res == 1024 || res == 64 { |  | ||||||
| 			outfile = fmt.Sprintf("icon_%dx%d@2x.png", res/2, res/2) |  | ||||||
| 		} |  | ||||||
| 		cmd := []string{ |  | ||||||
| 			"sips", "-s", "format", "png", "--resampleWidth", strconv.Itoa(res), |  | ||||||
| 			iconFile, "--out", path.Join(iconsetDir, outfile), |  | ||||||
| 		} |  | ||||||
| 		run(cmd...) |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	icnsFile := path.Join(resDir, "icon.icns") |  | ||||||
| 	run("iconutil", "-c", "icns", iconsetDir, "-o", icnsFile) |  | ||||||
| } |  | ||||||
							
								
								
									
										32
									
								
								doc/build.md
									
									
									
									
									
								
							
							
						
						
									
										32
									
								
								doc/build.md
									
									
									
									
									
								
							| @@ -1,21 +1,33 @@ | |||||||
| ## Compilation | ## Compilation | ||||||
|  |  | ||||||
| Install `Go >= 1.17` and `GCC`. Get the source code: | Prerequisies: | ||||||
|  |  | ||||||
|  | * Go >= 1.18 | ||||||
|  | * C Compiler (GCC / Clang / ...) | ||||||
|  | * Zig >= 0.14.0 (optional, for cross-compiling CLI versions) | ||||||
|  | * binutils (optional, for building Windows GUI version) | ||||||
|  |  | ||||||
|  | Get the source code: | ||||||
|  |  | ||||||
|     git clone https://github.com/nkanaev/yarr.git |     git clone https://github.com/nkanaev/yarr.git | ||||||
|  |  | ||||||
| Then run one of the corresponding commands: | Compile: | ||||||
|  |  | ||||||
|     # create an executable for the host os |     # create cli for the host OS/architecture | ||||||
|     make build_macos    # -> _output/macos/yarr.app |     make host               # out/yarr | ||||||
|     make build_linux    # -> _output/linux/yarr |  | ||||||
|     make build_windows  # -> _output/windows/yarr.exe |  | ||||||
|  |  | ||||||
|     # host-specific cli version (no gui) |     # create GUI, works only in the target OS | ||||||
|     make build_default  # -> _output/yarr |     make windows_amd64_gui  # out/windows_amd64_gui/yarr.exe | ||||||
|  |     make windows_arm64_gui  # out/windows_arm64_gui/yarr.exe | ||||||
|  |     make darwin_arm64_gui   # out/darwin_arm64_gui/yarr.app | ||||||
|  |     make darwin_amd64_gui   # out/darwin_amd64_gui/yarr.app | ||||||
|  |  | ||||||
|     # ... or start a dev server locally |     # create cli, cross-compiles within any OS/architecture | ||||||
|     make serve          # starts a server at http://localhost:7070 |     make linux_amd64 | ||||||
|  |     make linux_arm64 | ||||||
|  |     make linux_armv7 | ||||||
|  |     make windows_amd64 | ||||||
|  |     make windows_arm64 | ||||||
|  |  | ||||||
|     # ... or build a docker image |     # ... or build a docker image | ||||||
|     docker build -t yarr -f etc/dockerfile . |     docker build -t yarr -f etc/dockerfile . | ||||||
|   | |||||||
| @@ -3,12 +3,12 @@ RUN apk add build-base git | |||||||
| WORKDIR /src | WORKDIR /src | ||||||
| COPY . . | COPY . . | ||||||
| RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/root/go/pkg \ | RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/root/go/pkg \ | ||||||
|   make build_linux |   make host | ||||||
|  |  | ||||||
| FROM alpine:latest | FROM alpine:latest | ||||||
| RUN apk add --no-cache ca-certificates && \ | RUN apk add --no-cache ca-certificates && \ | ||||||
|     update-ca-certificates |     update-ca-certificates | ||||||
| COPY --from=build /src/_output/linux/yarr /usr/local/bin/yarr | COPY --from=build /src/out/yarr /usr/local/bin/yarr | ||||||
| EXPOSE 7070 | EXPOSE 7070 | ||||||
| ENTRYPOINT ["/usr/local/bin/yarr"] | ENTRYPOINT ["/usr/local/bin/yarr"] | ||||||
| CMD ["-addr", "0.0.0.0:7070", "-db", "/data/yarr.db"] | CMD ["-addr", "0.0.0.0:7070", "-db", "/data/yarr.db"] | ||||||
|   | |||||||
| @@ -27,18 +27,12 @@ RUN env \ | |||||||
|         CC=aarch64-linux-gnu-gcc \ |         CC=aarch64-linux-gnu-gcc \ | ||||||
|         CGO_ENABLED=1 \ |         CGO_ENABLED=1 \ | ||||||
|         GOOS=linux GOARCH=arm64 \ |         GOOS=linux GOARCH=arm64 \ | ||||||
|     go build \ |     make host && mv out/yarr /root/out/yarr.arm64 | ||||||
|         -tags "sqlite_foreign_keys linux" \ |  | ||||||
|         -ldflags="-s -w" \ |  | ||||||
|         -o /root/out/yarr.arm64 ./cmd/yarr |  | ||||||
|  |  | ||||||
| RUN env \ | RUN env \ | ||||||
|         CC=arm-linux-gnueabihf-gcc \ |         CC=arm-linux-gnueabihf-gcc \ | ||||||
|         CGO_ENABLED=1 \ |         CGO_ENABLED=1 \ | ||||||
|         GOOS=linux GOARCH=arm GOARM=7 \ |         GOOS=linux GOARCH=arm GOARM=7 \ | ||||||
|     go build \ |     make host && mv out/yarr /root/out/yarr.armv7 | ||||||
|         -tags "sqlite_foreign_keys linux" \ |  | ||||||
|         -ldflags="-s -w" \ |  | ||||||
|         -o /root/out/yarr.arm7 ./cmd/yarr |  | ||||||
|  |  | ||||||
| CMD ["/bin/bash"] | CMD ["/bin/bash"] | ||||||
|   | |||||||
							
								
								
									
										
											BIN
										
									
								
								etc/icon.icns
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								etc/icon.icns
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								etc/icon_macos.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								etc/icon_macos.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 54 KiB | 
							
								
								
									
										62
									
								
								etc/macos_package.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										62
									
								
								etc/macos_package.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,62 @@ | |||||||
|  | #/bin/sh | ||||||
|  |  | ||||||
|  | set -e | ||||||
|  |  | ||||||
|  | usage() { | ||||||
|  |   echo "usage: $0 VERSION path/to/icon.icns path/to/binary output/dir" | ||||||
|  | } | ||||||
|  |  | ||||||
|  | if [ $# -eq 0 ]; then | ||||||
|  |     usage | ||||||
|  |     exit | ||||||
|  | fi | ||||||
|  |  | ||||||
|  | VERSION=$1 | ||||||
|  | ICNFILE=$2 | ||||||
|  | BINFILE=$3 | ||||||
|  | OUTPATH=$4 | ||||||
|  |  | ||||||
|  | mkdir -p $OUTPATH/yarr.app/Contents/MacOS | ||||||
|  | mkdir -p $OUTPATH/yarr.app/Contents/Resources | ||||||
|  |  | ||||||
|  | mv $BINFILE $OUTPATH/yarr.app/Contents/MacOS/yarr | ||||||
|  | cp $ICNFILE $OUTPATH/yarr.app/Contents/Resources/icon.icns | ||||||
|  |  | ||||||
|  | chmod u+x  $OUTPATH/yarr.app/Contents/MacOS/yarr | ||||||
|  |  | ||||||
|  | echo -n 'APPL????' >$OUTPATH/yarr.app/Contents/PkgInfo | ||||||
|  | cat <<EOF >$OUTPATH/yarr.app/Contents/Info.plist | ||||||
|  | <?xml version="1.0" encoding="UTF-8"?> | ||||||
|  | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||||||
|  | <plist version="1.0"> | ||||||
|  | <dict> | ||||||
|  | 	<key>CFBundleName</key> | ||||||
|  | 	<string>yarr</string> | ||||||
|  | 	<key>CFBundleDisplayName</key> | ||||||
|  | 	<string>yarr</string> | ||||||
|  | 	<key>CFBundleIdentifier</key> | ||||||
|  | 	<string>nkanaev.yarr</string> | ||||||
|  | 	<key>CFBundleVersion</key> | ||||||
|  | 	<string>$VERSION</string> | ||||||
|  | 	<key>CFBundlePackageType</key> | ||||||
|  | 	<string>APPL</string> | ||||||
|  | 	<key>CFBundleExecutable</key> | ||||||
|  | 	<string>yarr</string> | ||||||
|  |  | ||||||
|  | 	<key>CFBundleIconFile</key> | ||||||
|  | 	<string>icon</string> | ||||||
|  | 	<key>LSApplicationCategoryType</key> | ||||||
|  | 	<string>public.app-category.news</string> | ||||||
|  |  | ||||||
|  | 	<key>NSHighResolutionCapable</key> | ||||||
|  | 	<string>True</string> | ||||||
|  |  | ||||||
|  | 	<key>LSMinimumSystemVersion</key> | ||||||
|  | 	<string>10.13</string> | ||||||
|  | 	<key>LSUIElement</key> | ||||||
|  | 	<true/> | ||||||
|  | 	<key>NSHumanReadableCopyright</key> | ||||||
|  | 	<string>Copyright © 2020 nkanaev. All rights reserved.</string> | ||||||
|  | </dict> | ||||||
|  | </plist> | ||||||
|  | EOF | ||||||
							
								
								
									
										89
									
								
								etc/windows_versioninfo.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										89
									
								
								etc/windows_versioninfo.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,89 @@ | |||||||
|  | #!/bin/bash | ||||||
|  |  | ||||||
|  | set -e | ||||||
|  |  | ||||||
|  | # Function to display usage information | ||||||
|  | usage() { | ||||||
|  |   echo "Usage: $0 [-version VERSION] [-outfile FILENAME]" | ||||||
|  |   echo "  -version VERSION   Set the version number (default: 0.0)" | ||||||
|  |   echo "  -outfile FILENAME  Set the output file name (default: versioninfo.rc)" | ||||||
|  |   echo "" | ||||||
|  |   echo "This script generates a Windows resource file with version information." | ||||||
|  |   exit 1 | ||||||
|  | } | ||||||
|  |  | ||||||
|  | # Default values | ||||||
|  | version="0.0" | ||||||
|  | outfile="versioninfo.rc" | ||||||
|  |  | ||||||
|  | # Check if help is requested | ||||||
|  | if [[ "$1" == "-h" || "$1" == "--help" ]]; then | ||||||
|  |   usage | ||||||
|  | fi | ||||||
|  |  | ||||||
|  | if [ $# -eq 0 ]; then | ||||||
|  |   usage | ||||||
|  | fi | ||||||
|  |  | ||||||
|  | # Parse command-line options | ||||||
|  | while [[ $# -gt 0 ]]; do | ||||||
|  |   case $1 in | ||||||
|  |     -version) | ||||||
|  |       if [[ -z "$2" || "$2" == -* ]]; then | ||||||
|  |         echo "Error: Missing value for -version parameter" | ||||||
|  |         usage | ||||||
|  |       fi | ||||||
|  |       version="$2" | ||||||
|  |       shift 2 | ||||||
|  |       ;; | ||||||
|  |     -outfile) | ||||||
|  |       if [[ -z "$2" || "$2" == -* ]]; then | ||||||
|  |         echo "Error: Missing value for -outfile parameter" | ||||||
|  |         usage | ||||||
|  |       fi | ||||||
|  |       outfile="$2" | ||||||
|  |       shift 2 | ||||||
|  |       ;; | ||||||
|  |     *) | ||||||
|  |       echo "Error: Unknown parameter: $1" | ||||||
|  |       usage | ||||||
|  |       ;; | ||||||
|  |   esac | ||||||
|  | done | ||||||
|  |  | ||||||
|  | # Replace dots with commas for version_comma | ||||||
|  | version_comma="${version//./,}" | ||||||
|  |  | ||||||
|  | # Use a here document for the template with ENDFILE delimiter | ||||||
|  | cat <<ENDFILE > "$outfile" | ||||||
|  | 1 VERSIONINFO | ||||||
|  | FILEVERSION     $version_comma,0,0 | ||||||
|  | PRODUCTVERSION  $version_comma,0,0 | ||||||
|  | BEGIN | ||||||
|  |   BLOCK "StringFileInfo" | ||||||
|  |   BEGIN | ||||||
|  |     BLOCK "080904E4" | ||||||
|  |     BEGIN | ||||||
|  |       VALUE "CompanyName", "Old MacDonald's Farm" | ||||||
|  |       VALUE "FileDescription", "Yet another RSS reader" | ||||||
|  |       VALUE "FileVersion", "$version" | ||||||
|  |       VALUE "InternalName", "yarr" | ||||||
|  |       VALUE "LegalCopyright", "nkanaev" | ||||||
|  |       VALUE "OriginalFilename", "yarr.exe" | ||||||
|  |       VALUE "ProductName", "yarr" | ||||||
|  |       VALUE "ProductVersion", "$version" | ||||||
|  |     END | ||||||
|  |   END | ||||||
|  |   BLOCK "VarFileInfo" | ||||||
|  |   BEGIN | ||||||
|  |     VALUE "Translation", 0x809, 1252 | ||||||
|  |   END | ||||||
|  | END | ||||||
|  |  | ||||||
|  | 1 ICON "icon.ico" | ||||||
|  | ENDFILE | ||||||
|  |  | ||||||
|  | # Set the correct permissions | ||||||
|  | chmod 644 "$outfile" | ||||||
|  |  | ||||||
|  | echo "Generated $outfile with version $version" | ||||||
							
								
								
									
										6
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								go.mod
									
									
									
									
									
								
							| @@ -4,8 +4,8 @@ go 1.18 | |||||||
|  |  | ||||||
| require ( | require ( | ||||||
| 	github.com/mattn/go-sqlite3 v1.14.7 | 	github.com/mattn/go-sqlite3 v1.14.7 | ||||||
| 	golang.org/x/net v0.33.0 | 	golang.org/x/net v0.36.0 | ||||||
| 	golang.org/x/sys v0.28.0 | 	golang.org/x/sys v0.30.0 | ||||||
| ) | ) | ||||||
|  |  | ||||||
| require golang.org/x/text v0.21.0 // indirect | require golang.org/x/text v0.22.0 // indirect | ||||||
|   | |||||||
							
								
								
									
										74
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										74
									
								
								go.sum
									
									
									
									
									
								
							| @@ -1,70 +1,8 @@ | |||||||
| github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= |  | ||||||
| github.com/mattn/go-sqlite3 v1.14.7 h1:fxWBnXkxfM6sRiuH3bqJ4CfzZojMOLVc0UTsTglEghA= | github.com/mattn/go-sqlite3 v1.14.7 h1:fxWBnXkxfM6sRiuH3bqJ4CfzZojMOLVc0UTsTglEghA= | ||||||
| github.com/mattn/go-sqlite3 v1.14.7/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= | github.com/mattn/go-sqlite3 v1.14.7/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= | ||||||
| github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= | golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA= | ||||||
| golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= | golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I= | ||||||
| golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= | golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= | ||||||
| golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= | golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= | ||||||
| golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= | golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= | ||||||
| golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= | golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= | ||||||
| golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= |  | ||||||
| golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= |  | ||||||
| golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= |  | ||||||
| golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= |  | ||||||
| golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= |  | ||||||
| golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= |  | ||||||
| golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= |  | ||||||
| golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= |  | ||||||
| golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= |  | ||||||
| golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= |  | ||||||
| golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= |  | ||||||
| golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= |  | ||||||
| golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= |  | ||||||
| golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= |  | ||||||
| golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= |  | ||||||
| golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= |  | ||||||
| golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= |  | ||||||
| golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= |  | ||||||
| golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= |  | ||||||
| golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= |  | ||||||
| golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= |  | ||||||
| golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= |  | ||||||
| golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= |  | ||||||
| golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= |  | ||||||
| golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= |  | ||||||
| golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= |  | ||||||
| golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= |  | ||||||
| golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= |  | ||||||
| golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= |  | ||||||
| golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= |  | ||||||
| golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= |  | ||||||
| golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= |  | ||||||
| golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= |  | ||||||
| golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= |  | ||||||
| golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= |  | ||||||
| golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= |  | ||||||
| golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= |  | ||||||
| golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= |  | ||||||
| golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= |  | ||||||
| golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= |  | ||||||
| golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= |  | ||||||
| golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= |  | ||||||
| golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= |  | ||||||
| golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= |  | ||||||
| golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= |  | ||||||
| golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= |  | ||||||
| golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= |  | ||||||
| golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= |  | ||||||
| golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= |  | ||||||
| golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= |  | ||||||
| golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= |  | ||||||
| golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= |  | ||||||
| golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= |  | ||||||
| golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= |  | ||||||
| golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= |  | ||||||
| golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= |  | ||||||
| golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= |  | ||||||
| golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= |  | ||||||
| golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= |  | ||||||
| golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= |  | ||||||
| golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= |  | ||||||
|   | |||||||
							
								
								
									
										93
									
								
								makefile
									
									
									
									
									
								
							
							
						
						
									
										93
									
								
								makefile
									
									
									
									
									
								
							| @@ -4,31 +4,86 @@ GITHASH=$(shell git rev-parse --short=8 HEAD) | |||||||
| GO_TAGS    = sqlite_foreign_keys sqlite_json | GO_TAGS    = sqlite_foreign_keys sqlite_json | ||||||
| GO_LDFLAGS = -s -w -X 'main.Version=$(VERSION)' -X 'main.GitHash=$(GITHASH)' | GO_LDFLAGS = -s -w -X 'main.Version=$(VERSION)' -X 'main.GitHash=$(GITHASH)' | ||||||
|  |  | ||||||
| export GOARCH      ?= amd64 | GO_FLAGS         = -tags "$(GO_TAGS)"     -ldflags="$(GO_LDFLAGS)" | ||||||
| export CGO_ENABLED  = 1 | GO_FLAGS_GUI     = -tags "$(GO_TAGS) gui" -ldflags="$(GO_LDFLAGS)" | ||||||
|  | GO_FLAGS_GUI_WIN = -tags "$(GO_TAGS) gui" -ldflags="$(GO_LDFLAGS) -H windowsgui" | ||||||
|  |  | ||||||
| build_default: | export CGO_ENABLED=1 | ||||||
| 	mkdir -p _output |  | ||||||
| 	go build -tags "$(GO_TAGS)" -ldflags="$(GO_LDFLAGS)" -o _output/yarr ./cmd/yarr |  | ||||||
|  |  | ||||||
| build_macos: | default: test host | ||||||
| 	mkdir -p _output/macos |  | ||||||
| 	GOOS=darwin go build -tags "$(GO_TAGS) macos" -ldflags="$(GO_LDFLAGS)" -o _output/macos/yarr ./cmd/yarr |  | ||||||
| 	cp src/platform/icon.png _output/macos/icon.png |  | ||||||
| 	go run ./cmd/package_macos -outdir _output/macos -version "$(VERSION)" |  | ||||||
|  |  | ||||||
| build_linux: | # platform-specific files | ||||||
| 	mkdir -p _output/linux |  | ||||||
| 	GOOS=linux go build -tags "$(GO_TAGS) linux" -ldflags="$(GO_LDFLAGS)" -o _output/linux/yarr ./cmd/yarr |  | ||||||
|  |  | ||||||
| build_windows: | etc/icon.icns: etc/icon_macos.png | ||||||
| 	mkdir -p _output/windows | 	mkdir -p etc/icon.iconset | ||||||
| 	go run ./cmd/generate_versioninfo -version "$(VERSION)" -outfile src/platform/versioninfo.rc | 	sips -s format png --resampleWidth 1024 etc/icon_macos.png --out etc/icon.iconset/icon_512x512@2x.png | ||||||
|  | 	sips -s format png --resampleWidth  512 etc/icon_macos.png --out etc/icon.iconset/icon_512x512.png | ||||||
|  | 	sips -s format png --resampleWidth  256 etc/icon_macos.png --out etc/icon.iconset/icon_256x256.png | ||||||
|  | 	sips -s format png --resampleWidth  128 etc/icon_macos.png --out etc/icon.iconset/icon_128x128.png | ||||||
|  | 	sips -s format png --resampleWidth   64 etc/icon_macos.png --out etc/icon.iconset/icon_32x32@2x.png | ||||||
|  | 	sips -s format png --resampleWidth   32 etc/icon_macos.png --out etc/icon.iconset/icon_32x32.png | ||||||
|  | 	sips -s format png --resampleWidth   16 etc/icon_macos.png --out etc/icon.iconset/icon_16x16.png | ||||||
|  | 	iconutil -c icns etc/icon.iconset -o etc/icon.icns | ||||||
|  |  | ||||||
|  | src/platform/versioninfo.rc: | ||||||
|  | 	./etc/windows_versioninfo.sh -version "$(VERSION)" -outfile src/platform/versioninfo.rc | ||||||
| 	windres -i src/platform/versioninfo.rc -O coff -o src/platform/versioninfo.syso | 	windres -i src/platform/versioninfo.rc -O coff -o src/platform/versioninfo.syso | ||||||
| 	GOOS=windows go build -tags "$(GO_TAGS) windows" -ldflags="$(GO_LDFLAGS) -H windowsgui" -o _output/windows/yarr.exe ./cmd/yarr |  | ||||||
|  | # build targets | ||||||
|  |  | ||||||
|  | host: | ||||||
|  | 	go build $(GO_FLAGS) -o out/yarr ./cmd/yarr | ||||||
|  |  | ||||||
|  | darwin_amd64: | ||||||
|  | 	# cross-compilation not supported: CC="zig cc -target x86_64-macos-none" | ||||||
|  | 	GOOS=darwin GOARCH=arm64 go build $(GO_FLAGS) -o out/$@/yarr ./cmd/yarr | ||||||
|  |  | ||||||
|  | darwin_arm64: | ||||||
|  | 	# cross-compilation not supported: CC="zig cc -target aarch64-macos-none" | ||||||
|  | 	GOOS=darwin GOARCH=arm64 go build $(GO_FLAGS) -o out/$@/yarr ./cmd/yarr | ||||||
|  |  | ||||||
|  | linux_amd64: | ||||||
|  | 	CC="zig cc -target x86_64-linux-musl -O2 -g0" CGO_CFLAGS="-D_LARGEFILE64_SOURCE" GOOS=linux GOARCH=amd64 \ | ||||||
|  | 	go build $(GO_FLAGS) -o out/$@/yarr ./cmd/yarr | ||||||
|  |  | ||||||
|  | linux_arm64: | ||||||
|  | 	CC="zig cc -target aarch64-linux-musl -O2 -g0" CGO_CFLAGS="-D_LARGEFILE64_SOURCE" GOOS=linux GOARCH=arm64 \ | ||||||
|  | 	go build $(GO_FLAGS) -o out/$@/yarr ./cmd/yarr | ||||||
|  |  | ||||||
|  | linux_armv7: | ||||||
|  | 	CC="zig cc -target arm-linux-musleabihf -O2 -g0" CGO_CFLAGS="-D_LARGEFILE64_SOURCE" GOOS=linux GOARCH=arm GOARM=7 \ | ||||||
|  | 	go build $(GO_FLAGS) -o out/$@/yarr ./cmd/yarr | ||||||
|  |  | ||||||
|  | windows_amd64: | ||||||
|  | 	CC="zig cc -target x86_64-windows-gnu" GOOS=windows GOARCH=amd64 go build $(GO_FLAGS) -o out/$@/yarr ./cmd/yarr | ||||||
|  |  | ||||||
|  | windows_arm64: | ||||||
|  | 	CC="zig cc -target aarch64-windows-gnu" GOOS=windows GOARCH=arm64 go build $(GO_FLAGS) -o out/$@/yarr ./cmd/yarr | ||||||
|  |  | ||||||
|  | darwin_arm64_gui: etc/icon.icns | ||||||
|  | 	GOOS=darwin GOARCH=arm64 go build $(GO_FLAGS_GUI) -o out/$@/yarr ./cmd/yarr | ||||||
|  | 	./etc/macos_package.sh $(VERSION) etc/icon.icns out/$@/yarr out/$@ | ||||||
|  |  | ||||||
|  | darwin_amd64_gui: etc/icon.icns | ||||||
|  | 	GOOS=darwin GOARCH=amd64 go build $(GO_FLAGS_GUI) -o out/$@/yarr ./cmd/yarr | ||||||
|  | 	./etc/macos_package.sh $(VERSION) etc/icon.icns out/$@/yarr out/$@ | ||||||
|  |  | ||||||
|  | windows_amd64_gui: src/platform/versioninfo.rc | ||||||
|  | 	GOOS=windows GOARCH=amd64 go build $(GO_FLAGS_GUI_WIN) -o out/$@/yarr.exe ./cmd/yarr | ||||||
|  |  | ||||||
|  | windows_arm64_gui: src/platform/versioninfo.rc | ||||||
|  | 	GOOS=windows GOARCH=arm64 go build $(GO_FLAGS_GUI_WIN) -o out/$@/yarr.exe ./cmd/yarr | ||||||
|  |  | ||||||
| serve: | serve: | ||||||
| 	go run -tags "$(GO_TAGS)" ./cmd/yarr -db local.db | 	go run $(GO_FLAGS) ./cmd/yarr -db local.db | ||||||
|  |  | ||||||
| test: | test: | ||||||
| 	go test -tags "$(GO_TAGS)" ./... | 	go test $(GO_FLAGS) ./... | ||||||
|  |  | ||||||
|  | .PHONY: \ | ||||||
|  | 	host \ | ||||||
|  | 	darwin_amd64 darwin_amd64_gui \ | ||||||
|  | 	darwin_arm64 darwin_arm64_gui \ | ||||||
|  | 	windows_amd64 windows_amd64_gui \ | ||||||
|  | 	windows_arm64 windows_arm64_gui \ | ||||||
|  | 	serve test | ||||||
|   | |||||||
| @@ -1,5 +1,4 @@ | |||||||
| //go:build !windows | //go:build !windows | ||||||
| // +build !windows |  | ||||||
|  |  | ||||||
| package platform | package platform | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,3 +1,5 @@ | |||||||
|  | //go:build windows | ||||||
|  |  | ||||||
| package platform | package platform | ||||||
|  |  | ||||||
| import ( | import ( | ||||||
|   | |||||||
| @@ -1,5 +1,4 @@ | |||||||
| //go:build macos || windows | //go:build (darwin || windows) && gui | ||||||
| // +build macos windows |  | ||||||
|  |  | ||||||
| package platform | package platform | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,5 +1,4 @@ | |||||||
| //go:build !windows && !macos | //go:build !gui | ||||||
| // +build !windows,!macos |  | ||||||
|  |  | ||||||
| package platform | package platform | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,5 +1,4 @@ | |||||||
| //go:build macos | //go:build darwin && gui | ||||||
| // +build macos |  | ||||||
|  |  | ||||||
| package platform | package platform | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,5 +1,4 @@ | |||||||
| //go:build windows | //go:build windows && gui | ||||||
| // +build windows |  | ||||||
|  |  | ||||||
| package platform | package platform | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,5 +1,4 @@ | |||||||
| //go:build !windows && !darwin | //go:build linux | ||||||
| // +build !windows,!darwin |  | ||||||
|  |  | ||||||
| package platform | package platform | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,5 +1,4 @@ | |||||||
| //go:build darwin | //go:build darwin | ||||||
| // +build darwin |  | ||||||
|  |  | ||||||
| package platform | package platform | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,5 +1,4 @@ | |||||||
| //go:build windows | //go:build windows | ||||||
| // +build windows |  | ||||||
|  |  | ||||||
| package platform | package platform | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										11
									
								
								vendor/golang.org/x/sys/windows/dll_windows.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								vendor/golang.org/x/sys/windows/dll_windows.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -43,8 +43,8 @@ type DLL struct { | |||||||
| // LoadDLL loads DLL file into memory. | // LoadDLL loads DLL file into memory. | ||||||
| // | // | ||||||
| // Warning: using LoadDLL without an absolute path name is subject to | // Warning: using LoadDLL without an absolute path name is subject to | ||||||
| // DLL preloading attacks. To safely load a system DLL, use LazyDLL | // DLL preloading attacks. To safely load a system DLL, use [NewLazySystemDLL], | ||||||
| // with System set to true, or use LoadLibraryEx directly. | // or use [LoadLibraryEx] directly. | ||||||
| func LoadDLL(name string) (dll *DLL, err error) { | func LoadDLL(name string) (dll *DLL, err error) { | ||||||
| 	namep, err := UTF16PtrFromString(name) | 	namep, err := UTF16PtrFromString(name) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| @@ -271,6 +271,9 @@ func (d *LazyDLL) NewProc(name string) *LazyProc { | |||||||
| } | } | ||||||
|  |  | ||||||
| // NewLazyDLL creates new LazyDLL associated with DLL file. | // NewLazyDLL creates new LazyDLL associated with DLL file. | ||||||
|  | // | ||||||
|  | // Warning: using NewLazyDLL without an absolute path name is subject to | ||||||
|  | // DLL preloading attacks. To safely load a system DLL, use [NewLazySystemDLL]. | ||||||
| func NewLazyDLL(name string) *LazyDLL { | func NewLazyDLL(name string) *LazyDLL { | ||||||
| 	return &LazyDLL{Name: name} | 	return &LazyDLL{Name: name} | ||||||
| } | } | ||||||
| @@ -410,7 +413,3 @@ func loadLibraryEx(name string, system bool) (*DLL, error) { | |||||||
| 	} | 	} | ||||||
| 	return &DLL{Name: name, Handle: h}, nil | 	return &DLL{Name: name, Handle: h}, nil | ||||||
| } | } | ||||||
|  |  | ||||||
| type errString string |  | ||||||
|  |  | ||||||
| func (s errString) Error() string { return string(s) } |  | ||||||
|   | |||||||
							
								
								
									
										8
									
								
								vendor/modules.txt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								vendor/modules.txt
									
									
									
									
										vendored
									
									
								
							| @@ -1,15 +1,15 @@ | |||||||
| # github.com/mattn/go-sqlite3 v1.14.7 | # github.com/mattn/go-sqlite3 v1.14.7 | ||||||
| ## explicit; go 1.12 | ## explicit; go 1.12 | ||||||
| github.com/mattn/go-sqlite3 | github.com/mattn/go-sqlite3 | ||||||
| # golang.org/x/net v0.33.0 | # golang.org/x/net v0.36.0 | ||||||
| ## explicit; go 1.18 | ## explicit; go 1.23 | ||||||
| golang.org/x/net/html | golang.org/x/net/html | ||||||
| golang.org/x/net/html/atom | golang.org/x/net/html/atom | ||||||
| golang.org/x/net/html/charset | golang.org/x/net/html/charset | ||||||
| # golang.org/x/sys v0.28.0 | # golang.org/x/sys v0.30.0 | ||||||
| ## explicit; go 1.18 | ## explicit; go 1.18 | ||||||
| golang.org/x/sys/windows | golang.org/x/sys/windows | ||||||
| # golang.org/x/text v0.21.0 | # golang.org/x/text v0.22.0 | ||||||
| ## explicit; go 1.18 | ## explicit; go 1.18 | ||||||
| golang.org/x/text/encoding | golang.org/x/text/encoding | ||||||
| golang.org/x/text/encoding/charmap | golang.org/x/text/encoding/charmap | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user