The problem i'm receiving is at the very end of the compile... it looks like it 99% works but fails just before it crosses the finish line.
I'm receive a shell error at the end of the geany 2.0 source code compile under wsl under windows: Here's the error and my scripts i'm using to build geany 2.0 under windows wsl. Note, I needed this to build all from source instead of normal sudo apt install method...
```txt configure: WARNING: unrecognized options: --with-gtk ------------------------------------------------------ Install Geany in : /home/user1/geany Using GTK version : Enable binary relocation : no Build with plugin support : yes Use (UNIX domain) socket support : yes Use virtual terminal support (VTE) : yes Build HTML documentation : no Build PDF documentation : no Build API documentation : no Generate GtkDoc header : no
Configuration is done OK.
Compiling Geany... sh: 1: Syntax error: ")" unexpected Make failed at install_geany.pl line 58, <STDIN> line 1. ```
## Compile GTK3+ source for Windows WSL:
```pl #!/usr/bin/perl use strict; use warnings; use File::Basename;
# Base directory for local installation my $install_dir = "$ENV{HOME}/local"; my $meson_bin = "$ENV{HOME}/.local/bin/meson"; # Meson binary location my $ninja_bin = "$ENV{HOME}/.local/bin/ninja"; # Ninja binary location
# List of dependencies with their URLs and build system preferences my @dependencies = ( { name => 'glib', url => 'https://download.gnome.org/sources/glib/2.68/glib-2.68.4.tar.xz', build_with_meson => 1, }, # Add other dependencies here if needed );
# Function to install a Python package locally if not already installed sub install_python_package { my ($package) = @_; system("python3 -m pip install --user $package") == 0 or die "Failed to install $package with pip. Please check your Python and pip installation.\n"; }
# Check for Meson and Ninja, installing them if necessary unless (-x $meson_bin) { print "Meson not found, attempting to install locally with pip...\n"; install_python_package("meson"); die "Meson installation failed. Please install manually." unless -x $meson_bin; print "Meson installed successfully.\n"; }
unless (-x $ninja_bin) { print "Ninja not found, attempting to install locally with pip...\n"; install_python_package("ninja"); die "Ninja installation failed. Please install manually." unless -x $ninja_bin; print "Ninja installed successfully.\n"; }
# Set up environment variables for Meson, Ninja, and local installation paths $ENV{PKG_CONFIG_PATH} = "$install_dir/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}"; $ENV{LD_LIBRARY_PATH} = "$install_dir/lib:$ENV{LD_LIBRARY_PATH}"; $ENV{PATH} = "$install_dir/bin:$ENV{PATH}"; $ENV{PATH} .= ":$ENV{HOME}/.local/bin"; # Add local bin to PATH
foreach my $dep (@dependencies) { my $url = $dep->{url}; my $filename = basename($url); my $dirname = $filename; $dirname =~ s/.tar.xz$//;
# Step 1: Download the source archive print "Downloading $filename...\n"; system("curl -LO $url") == 0 or die "Failed to download $filename\n";
# Step 2: Extract the archive print "Extracting $filename...\n"; system("tar -xf $filename") == 0 or die "Failed to extract $filename\n";
# Step 3: Build and install chdir $dirname or die "Cannot enter directory $dirname\n"; if ($dep->{build_with_meson}) { print "Configuring $dep->{name} with Meson...\n"; system("$meson_bin setup builddir --prefix=$install_dir") == 0 or die "Failed to configure $dep->{name} with Meson\n";
print "Building $dep->{name} with Ninja...\n"; system("$ninja_bin -C builddir") == 0 or die "Failed to build $dep->{name} with Ninja\n";
print "Installing $dep->{name}...\n"; system("$ninja_bin -C builddir install") == 0 or die "Failed to install $dep->{name}\n"; } else { print "Configuring $dep->{name} with Autotools...\n"; system("./configure --prefix=$install_dir") == 0 or die "Failed to configure $dep->{name}\n";
print "Building $dep->{name}...\n"; system("make -j$(nproc)") == 0 or die "Failed to build $dep->{name}\n";
print "Installing $dep->{name}...\n"; system("make install") == 0 or die "Failed to install $dep->{name}\n"; }
# Step 4: Cleanup and return to initial directory chdir ".."; unlink $filename; # Delete the archive after extraction system("rm -rf $dirname"); # Optionally delete the source directory after installation }
print "All dependencies are installed in $install_dir.\n"; print "Environment variables have been set for the current session.\n"; ```
## Compile Geany 2.0 source for Window WSL
```pl #!/usr/bin/perl use strict; use warnings; use File::Basename;
print "\n"; print "L3Harris pre-requisite before running this script:\n"; print " 2. perl install_gtk3.pl\n"; print "press <enter> to continue. <Ctrl-C> to exit.\n"; <STDIN>;
# Define URLs and directories my $geany_url = 'https://download.geany.org/geany-2.0.tar.gz'; # Replace with the actual Geany version URL if different my $home_dir = $ENV{'HOME'}; my $install_dir = "$home_dir/geany"; # Geany installation directory my $gtk_dir = "$home_dir/local"; # Local GTK+ installation from the previous script
# Ensure Geany installation directory exists unless (-d $install_dir) { mkdir $install_dir or die "Failed to create directory $install_dir: $!"; }
# Temporarily remove paths with spaces from PATH my $original_path = $ENV{PATH}; $ENV{PATH} = join ":", grep { $_ !~ / / } split ":", $ENV{PATH};
# Download Geany source print "Downloading Geany source...\n"; system("curl -L $geany_url -o geany-2.0.tar.gz") == 0 or die "Failed to download Geany source";
# Extract the Geany source tarball print "Extracting source files...\n"; system("tar -xf geany-2.0.tar.gz") == 0 or die "Failed to extract Geany source";
# Change directory to the extracted Geany source chdir 'geany-2.0' or die "Failed to change directory to Geany source: $!";
# Set environment variables for GTK+ libraries $ENV{PKG_CONFIG_PATH} = "$gtk_dir/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}"; $ENV{LD_LIBRARY_PATH} = "$gtk_dir/lib:$ENV{LD_LIBRARY_PATH}"; $ENV{CFLAGS} = "-I$gtk_dir/include"; $ENV{LDFLAGS} = "-L$gtk_dir/lib";
# Set GTK-specific environment variables for configure to find GTK+ 3 $ENV{GTK_CFLAGS} = "-I$gtk_dir/include/gtk-3.0"; $ENV{GTK_LIBS} = "-L$gtk_dir/lib -lgtk-3";
# Configure build with the GTK+ prefix print "Configuring the build for Geany...\n"; system("./configure --prefix=$install_dir --with-gtk=3.0") == 0 or die "Configure failed";
# Compile Geany print "Compiling Geany...\n"; system("make -j$(nproc)") == 0 or die "Make failed";
# Install Geany to the specified directory print "Installing Geany to $install_dir...\n"; system("make install") == 0 or die "Make install failed";
# Restore original PATH $ENV{PATH} = $original_path;
# Clean up downloaded and extracted files chdir '..'; unlink 'geany-2.0.tar.gz'; system("rm -rf geany-2.0") == 0 or warn "Failed to clean up extracted files";
print "Geany installed in $install_dir\n"; ```