Skip to content

Commit 4155d1a

Browse files
committed
chore: wip
1 parent 2f05400 commit 4155d1a

File tree

4 files changed

+514
-1794
lines changed

4 files changed

+514
-1794
lines changed

.github/workflows/build-binaries.yml

Lines changed: 65 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -91,63 +91,73 @@ jobs:
9191
- name: Install build dependencies (Ubuntu)
9292
if: matrix.platform == 'linux'
9393
run: |
94-
sudo apt-get update
95-
sudo apt-get install -y \
96-
build-essential \
97-
autoconf \
98-
automake \
99-
libtool \
100-
pkg-config \
101-
bison \
102-
re2c \
103-
libxml2-dev \
104-
libssl-dev \
105-
libcurl4-openssl-dev \
106-
libpng-dev \
107-
libjpeg-dev \
108-
libfreetype6-dev \
109-
libonig-dev \
110-
libzip-dev \
111-
libsqlite3-dev \
112-
libpq-dev \
113-
libreadline-dev \
114-
libbz2-dev \
115-
libgmp-dev \
116-
libldap2-dev \
117-
libsasl2-dev \
118-
libxslt1-dev \
119-
libicu-dev \
120-
libsodium-dev \
121-
zlib1g-dev
94+
# Use Launchpad to install PHP dependencies automatically
95+
# This replaces the manual apt-get install of all dependencies
96+
launchpad install --deps-only php
97+
98+
# Alternative: Use apt-get for manual dependency installation
99+
# sudo apt-get update
100+
# sudo apt-get install -y \
101+
# build-essential \
102+
# autoconf \
103+
# automake \
104+
# libtool \
105+
# pkg-config \
106+
# bison \
107+
# re2c \
108+
# libxml2-dev \
109+
# libssl-dev \
110+
# libcurl4-openssl-dev \
111+
# libpng-dev \
112+
# libjpeg-dev \
113+
# libfreetype6-dev \
114+
# libonig-dev \
115+
# libzip-dev \
116+
# libsqlite3-dev \
117+
# libpq-dev \
118+
# libreadline-dev \
119+
# libbz2-dev \
120+
# libgmp-dev \
121+
# libldap2-dev \
122+
# libsasl2-dev \
123+
# libxslt1-dev \
124+
# libicu-dev \
125+
# libsodium-dev \
126+
# zlib1g-dev
122127
123128
- name: Install build dependencies (macOS)
124129
if: matrix.platform == 'darwin'
125130
run: |
126-
# Use Homebrew for consistent dependencies
127-
brew install \
128-
autoconf \
129-
automake \
130-
libtool \
131-
pkg-config \
132-
bison \
133-
re2c \
134-
libxml2 \
135-
openssl@3 \
136-
curl \
137-
libpng \
138-
jpeg \
139-
freetype \
140-
oniguruma \
141-
libzip \
142-
postgresql \
143-
readline \
144-
bzip2 \
145-
gmp \
146-
openldap \
147-
libxslt \
148-
icu4c \
149-
libsodium \
150-
zlib
131+
# Use Launchpad to install PHP dependencies automatically
132+
# This replaces the manual brew install of all dependencies
133+
launchpad install --deps-only php
134+
135+
# Alternative: Use Homebrew for manual dependency installation
136+
# brew install \
137+
# autoconf \
138+
# automake \
139+
# libtool \
140+
# pkg-config \
141+
# bison \
142+
# re2c \
143+
# libxml2 \
144+
# openssl@3 \
145+
# curl \
146+
# libpng \
147+
# jpeg \
148+
# freetype \
149+
# oniguruma \
150+
# libzip \
151+
# postgresql \
152+
# readline \
153+
# bzip2 \
154+
# gmp \
155+
# openldap \
156+
# libxslt \
157+
# icu4c \
158+
# libsodium \
159+
# zlib \
160+
# libiconv
151161
152162
- name: Create build configuration
153163
run: |
@@ -204,8 +214,8 @@ jobs:
204214
205215
# Configure with platform-specific options
206216
if [[ "${{ matrix.platform }}" == "darwin" ]]; then
207-
# On macOS, let configure auto-detect iconv from system/Homebrew
208-
EXTRA_CONFIG=""
217+
# On macOS, point to Homebrew iconv installation
218+
EXTRA_CONFIG="--with-iconv=$(brew --prefix libiconv)"
209219
else
210220
# On Linux, explicitly enable iconv (usually available in system)
211221
EXTRA_CONFIG="--with-iconv"

packages/launchpad/bin/cli.ts

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { homedir } from 'node:os'
44
import path from 'node:path'
55
import process from 'node:process'
66
import { CAC } from 'cac'
7-
import { install, install_prefix, list, uninstall } from '../src'
7+
import { install, install_prefix, installDependenciesOnly, list, uninstall } from '../src'
88
import { config } from '../src/config'
99
import { dump, integrate, shellcode } from '../src/dev'
1010
import { formatDoctorReport, runDoctorChecks } from '../src/doctor'
@@ -773,11 +773,13 @@ cli
773773
.option('--verbose', 'Enable verbose output')
774774
.option('--path <path>', 'Custom installation path')
775775
.option('--global-deps', 'Install all global dependencies found across the machine')
776+
.option('--deps-only', 'Install only the dependencies of packages, not the packages themselves')
776777
.option('--dry-run', 'Show packages that would be installed without installing them')
777778
.option('--quiet', 'Suppress non-error output')
778779
.option('--shell', 'Output shell code for evaluation (use with eval)')
779780
.example('launchpad install node python')
780781
.example('launchpad install --path ~/.local node python')
782+
.example('launchpad install --deps-only php')
781783
.example('launchpad install')
782784
.example('launchpad install ./my-project')
783785
.example('launchpad install --global-deps')
@@ -786,6 +788,7 @@ cli
786788
verbose?: boolean
787789
path?: string
788790
globalDeps?: boolean
791+
depsOnly?: boolean
789792
dryRun?: boolean
790793
quiet?: boolean
791794
shell?: boolean
@@ -804,6 +807,37 @@ cli
804807
return
805808
}
806809

810+
// Handle dependencies-only installation
811+
if (options.depsOnly) {
812+
if (packageList.length === 0) {
813+
console.error('Error: --deps-only requires at least one package to be specified')
814+
process.exit(1)
815+
}
816+
817+
const defaultInstallPath = path.join(homedir(), '.local', 'share', 'launchpad', 'global')
818+
const installPath = options.path || defaultInstallPath
819+
const results = await installDependenciesOnly(packageList, installPath)
820+
821+
// Create symlinks to ~/.local/bin for global accessibility when using default path
822+
if (!options.path) {
823+
await createGlobalBinarySymlinks(installPath)
824+
}
825+
826+
if (!options.quiet) {
827+
if (results.length > 0) {
828+
console.log(`🎉 Successfully installed dependencies for ${packageList.join(', ')} (${results.length} ${results.length === 1 ? 'file' : 'files'})`)
829+
if (options.verbose) {
830+
results.forEach((file) => {
831+
console.log(` ${file}`)
832+
})
833+
}
834+
} else {
835+
console.log('⚠️ No dependencies were installed')
836+
}
837+
}
838+
return
839+
}
840+
807841
// Handle development environment setup (no packages specified or directory path given)
808842
if (packageList.length === 0 || (packageList.length === 1 && await isDirectory(packageList[0]))) {
809843
const targetDir = packageList.length === 1 ? path.resolve(packageList[0]) : process.cwd()

0 commit comments

Comments
 (0)