-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from alvarorichard/ipc
Ipc
- Loading branch information
Showing
18 changed files
with
1,672 additions
and
380 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
|
||
|
||
|
||
#!/bin/bash | ||
|
||
# Exit immediately if a command exits with a non-zero status | ||
set -e | ||
|
||
# Variables | ||
OUTPUT_DIR="../build" # Adjusted to place the binary in the build directory | ||
BINARY_NAME="goanime-linux" | ||
BINARY_PATH="$OUTPUT_DIR/$BINARY_NAME" | ||
TARBALL_NAME="$BINARY_NAME.tar.gz" | ||
TARBALL_PATH="$OUTPUT_DIR/$TARBALL_NAME" | ||
CHECKSUM_FILE="$TARBALL_PATH.sha256" | ||
MAIN_PACKAGE="../cmd/goanime" | ||
|
||
# Create the output directory if it doesn't exist | ||
mkdir -p "$OUTPUT_DIR" | ||
|
||
echo "Building the goanime binary for Linux..." | ||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o "$BINARY_PATH" -ldflags="-s -w" -trimpath "$MAIN_PACKAGE" | ||
|
||
echo "Build completed: $BINARY_PATH" | ||
|
||
# Check if UPX is installed | ||
if command -v upx >/dev/null 2>&1; then | ||
echo "Compressing the binary with UPX..." | ||
upx --best --ultra-brute "$BINARY_PATH" | ||
echo "Compression completed." | ||
else | ||
echo "UPX not found. Skipping compression." | ||
fi | ||
|
||
# Create tarball | ||
echo "Creating tarball..." | ||
tar -czf "$TARBALL_PATH" -C "$OUTPUT_DIR" "$BINARY_NAME" | ||
echo "Tarball created: $TARBALL_PATH" | ||
|
||
# Generate SHA256 checksum for the tarball | ||
echo "Generating SHA256 checksum for the tarball..." | ||
# Check if sha256sum exists, else use shasum | ||
if command -v sha256sum >/dev/null 2>&1; then | ||
sha256sum "$TARBALL_PATH" > "$CHECKSUM_FILE" | ||
elif command -v shasum >/dev/null 2>&1; then | ||
shasum -a 256 "$TARBALL_PATH" > "$CHECKSUM_FILE" | ||
else | ||
echo "Neither sha256sum nor shasum is available. Cannot generate checksum." | ||
exit 1 | ||
fi | ||
echo "Checksum generated: $CHECKSUM_FILE" | ||
|
||
echo "Build script completed successfully." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
|
||
|
||
|
||
|
||
#!/bin/bash | ||
|
||
# Exit immediately if a command exits with a non-zero status | ||
set -e | ||
|
||
# Variables | ||
OUTPUT_DIR="../build" # Adjusted to place the binary in the build directory | ||
BINARY_NAME="goanime-apple-darwin" | ||
BINARY_PATH="$OUTPUT_DIR/$BINARY_NAME" | ||
TARBALL_NAME="$BINARY_NAME.tar.gz" | ||
TARBALL_PATH="$OUTPUT_DIR/$TARBALL_NAME" | ||
CHECKSUM_FILE="$TARBALL_PATH.sha256" | ||
MAIN_PACKAGE="../cmd/goanime" | ||
|
||
# Create the output directory if it doesn't exist | ||
mkdir -p "$OUTPUT_DIR" | ||
|
||
echo "Building the goanime binary for macOS..." | ||
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o "$BINARY_PATH" -ldflags="-s -w" -trimpath "$MAIN_PACKAGE" | ||
|
||
echo "Build completed: $BINARY_PATH" | ||
|
||
# Check if UPX is installed | ||
if command -v upx >/dev/null 2>&1; then | ||
echo "Compressing the binary with UPX..." | ||
upx --best --ultra-brute "$BINARY_PATH" | ||
echo "Compression completed." | ||
else | ||
echo "UPX not found. Skipping compression." | ||
fi | ||
|
||
# Create tarball | ||
echo "Creating tarball..." | ||
tar -czf "$TARBALL_PATH" -C "$OUTPUT_DIR" "$BINARY_NAME" | ||
echo "Tarball created: $TARBALL_PATH" | ||
|
||
# Generate SHA256 checksum for the tarball | ||
echo "Generating SHA256 checksum for the tarball..." | ||
if command -v shasum >/dev/null 2>&1; then | ||
shasum -a 256 "$TARBALL_PATH" > "$CHECKSUM_FILE" | ||
elif command -v openssl >/dev/null 2>&1; then | ||
openssl dgst -sha256 "$TARBALL_PATH" | awk '{print $2}' > "$CHECKSUM_FILE" | ||
else | ||
echo "Neither shasum nor openssl is available. Cannot generate checksum." | ||
exit 1 | ||
fi | ||
echo "Checksum generated: $CHECKSUM_FILE" | ||
|
||
echo "Build script completed successfully." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
|
||
|
||
#!/bin/bash | ||
|
||
# Sai imediatamente se um comando falhar | ||
set -e | ||
|
||
# Variáveis | ||
OUTPUT_DIR="../build" # Diretório de saída para o binário e checksum | ||
BINARY_NAME="goanime.exe" # Nome do binário para Windows | ||
BINARY_PATH="$OUTPUT_DIR/$BINARY_NAME" | ||
ZIP_NAME="goanime-windows.zip" | ||
ZIP_PATH="$OUTPUT_DIR/$ZIP_NAME" | ||
CHECKSUM_FILE="$ZIP_PATH.sha256" | ||
MAIN_PACKAGE="../cmd/goanime" | ||
|
||
# Detecta a arquitetura | ||
ARCH=$(uname -m) | ||
if [ "$ARCH" == "x86_64" ]; then | ||
GOARCH=amd64 | ||
elif [ "$ARCH" == "arm64" ]; then | ||
GOARCH=arm64 | ||
else | ||
echo "Arquitetura não suportada: $ARCH" | ||
exit 1 | ||
fi | ||
|
||
# Cria o diretório de saída se não existir | ||
mkdir -p "$OUTPUT_DIR" | ||
|
||
echo "Compilando o binário goanime para Windows ($GOARCH)..." | ||
CGO_ENABLED=0 GOOS=windows GOARCH=$GOARCH go build -o "$BINARY_PATH" -ldflags="-s -w" -trimpath "$MAIN_PACKAGE" | ||
|
||
echo "Compilação concluída: $BINARY_PATH" | ||
|
||
# Verifica se o UPX está instalado | ||
if command -v upx >/dev/null 2>&1; then | ||
echo "Comprimindo o binário com UPX..." | ||
upx --best --ultra-brute "$BINARY_PATH" | ||
echo "Compressão concluída." | ||
else | ||
echo "UPX não encontrado. Pulando compressão." | ||
fi | ||
|
||
# Cria arquivo ZIP | ||
echo "Criando arquivo ZIP..." | ||
zip -j "$ZIP_PATH" "$BINARY_PATH" | ||
echo "Arquivo ZIP criado: $ZIP_PATH" | ||
|
||
# Gera o checksum SHA256 para o arquivo ZIP | ||
echo "Gerando checksum SHA256 para o arquivo ZIP..." | ||
if command -v sha256sum >/dev/null 2>&1; then | ||
sha256sum "$ZIP_PATH" > "$CHECKSUM_FILE" | ||
elif command -v shasum >/dev/null 2>&1; then | ||
shasum -a 256 "$ZIP_PATH" > "$CHECKSUM_FILE" | ||
elif command -v openssl >/dev/null 2>&1; then | ||
openssl dgst -sha256 "$ZIP_PATH" | awk '{print $2}' > "$CHECKSUM_FILE" | ||
else | ||
echo "Nem sha256sum, shasum ou openssl estão disponíveis. Não é possível gerar o checksum." | ||
exit 1 | ||
fi | ||
echo "Checksum gerado: $CHECKSUM_FILE" | ||
|
||
echo "Script de build concluído com sucesso." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
[Setup] | ||
AppName=GoAnime Installer | ||
AppVersion=1.0.8 | ||
DefaultDirName={pf}\GoAnime | ||
DefaultGroupName=GoAnime | ||
AllowNoIcons=yes | ||
OutputBaseFilename=GoAnimeInstaller | ||
UsePreviousAppDir=yes | ||
Compression=lzma2 | ||
SolidCompression=yes | ||
|
||
[Tasks] | ||
Name: "desktopicon"; Description: "Create a &desktop shortcut"; GroupDescription: "Additional Options"; | ||
|
||
[Files] | ||
; Copia o executável principal do GoAnime | ||
Source: "C:\Users\krone\Documents\GoAnime\build\goanime.exe"; DestDir: "{app}"; Flags: ignoreversion | ||
|
||
; Copia os binários de mpv e yt-dlp para a pasta bin dentro do diretório de instalação | ||
Source: "C:\Users\krone\Documents\GoAnime\build\mpv.exe"; DestDir: "{app}\bin"; Flags: ignoreversion | ||
Source: "C:\Users\krone\Documents\GoAnime\build\yt-dlp.exe"; DestDir: "{app}\bin"; Flags: ignoreversion | ||
|
||
[Icons] | ||
; Cria o atalho no Menu Iniciar | ||
Name: "{group}\GoAnime"; Filename: "{app}\goanime.exe" | ||
|
||
; Cria o atalho na área de trabalho, se o usuário selecionar essa opção | ||
Name: "{userdesktop}\GoAnime"; Filename: "{app}\goanime.exe"; Tasks: desktopicon | ||
|
||
[Run] | ||
; Adiciona mpv e yt-dlp ao PATH do usuário | ||
Filename: "{cmd}"; Parameters: "/C setx PATH ""{app}\bin;%PATH%"""; Flags: runhidden runascurrentuser |
Oops, something went wrong.