11name : wechat-devtools # you probably want to 'snapcraft register <name>'
22base : core18 # the base snap is the execution environment for this snap
3- version : ' 0.1 ' # just for humans, typically '1.2+git' or '1.3.2'
3+ version : ' 1.05.2203070-9 ' # just for humans, typically '1.2+git' or '1.3.2'
44summary : WeChat Devtools for Linux # 79 char long summary
55description : |
66 WeChat Devtools for Linux.
@@ -19,28 +19,34 @@ architectures:
1919# snap
2020# /root/parts/my-part/src/nw
2121parts :
22- # compiler:
23- # plugin: nil
24- # source: https://download.fastgit.org/msojocs/wechat-devtools-linux/releases/download/v0.6/compiler.tar.xz
25-
2622 node-js :
2723 plugin : dump
2824 source : https://npmmirror.com/mirrors/node/v16.4.2/node-v16.4.2-linux-x64.tar.gz
29- # source: './ cache/node-v16.4.2-linux-x64.tar.gz'
25+ # source: cache/node-v16.4.2-linux-x64.tar.gz
3026 organize :
31- " * " : nodejs/
32- stage :
33- - nodejs/*
34-
35- devtools :
27+ " * " : node/
28+ override-build : |
29+ mkdir -p $SNAPCRAFT_STAGE/node
30+ cp -r * $SNAPCRAFT_STAGE/node
31+ ls -l
32+ ls -l $SNAPCRAFT_PART_INSTALL
33+ package-nw :
3634 plugin : dump
3735 source : https://servicewechat.com/wxa-dev-logic/download_redirect?type=x64&from=mpwiki&download_version=1052203070&version_type=1
38- # source: ./ cache/wechat_devtools_1.05.2201240_x64 .exe
36+ # source: cache/wechat_devtools_1.05.2203070_x64 .exe
3937 source-type : 7z
40- source-subdir : ./code
38+ source-subdir : code
39+ override-build : |
40+ chmod -R 755 code/package.nw
41+ cp -r code/package.nw $SNAPCRAFT_STAGE
42+ # after 会执行到stage
43+
44+ build-node :
45+ plugin : nil
4146 build-environment :
42- - PATH : " $SNAPCRAFT_STAGE/nodejs /bin:$PATH"
47+ - PATH : " $SNAPCRAFT_STAGE/node /bin:$PATH"
4348 - NW_VERSION : 0.55.0
49+ - NO_WINE : ' true'
4450 # - NW_PACKAGE_DIR: "$SNAPCRAFT_PART_BUILD/code/package.nw"
4551 # - srcdir: "$SNAPCRAFT_PROJECT_DIR"
4652 build-packages :
@@ -53,71 +59,104 @@ parts:
5359 - make
5460 - openssl
5561 - libssh2-1-dev
62+ override-pull : |
63+ ls -l
5664 override-build : |
5765 env
58- echo "3"
59- ls -l $SNAPCRAFT_STAGE
66+ echo "=============3============"
67+ ls -l $SNAPCRAFT_PART_SRC
68+ ls -l $SNAPCRAFT_PART_BUILD
69+ ls -l $SNAPCRAFT_PART_INSTALL
70+ ls -l $SNAPCRAFT_PRIME
6071 ls -l $SNAPCRAFT_PROJECT_DIR
72+ ls -l $SNAPCRAFT_STAGE
73+ ls -l
74+
75+ # 准备文件
76+ cp -r $SNAPCRAFT_STAGE/package.nw package.nw
77+ chmod -R 755 package.nw
78+ cp -r "${SNAPCRAFT_PROJECT_DIR}/tools" tools
79+ cp -r "${SNAPCRAFT_PROJECT_DIR}/compiler" compiler
6180
6281 # 执行构建脚本
63- chmod -R 755 $SNAPCRAFT_PART_BUILD/code/package.nw
6482 npm install node-gyp nw-gyp -g --registry=https://registry.npm.taobao.org
6583 node-gyp install --registry=https://registry.npm.taobao.org
6684
67- cp -r "${SNAPCRAFT_PROJECT_DIR}/tools" "$SNAPCRAFT_PART_BUILD/code/tools"
68- cp -r "${SNAPCRAFT_PROJECT_DIR}/compiler" "$SNAPCRAFT_PART_BUILD/code/compiler"
6985 for script in fix-package-name.js fix-cli.sh fix-core.sh fix-other.sh; do
7086 echo -e "\e[1;34mrun ${script}\e[0m"
71- "${SNAPCRAFT_PART_BUILD}/code/ tools/${script}"
87+ tools/${script}
7288 done
7389 # 构建模块
74- "${SNAPCRAFT_PART_BUILD}/code/ tools/rebuild-node-modules.sh" $NW_VERSION
75- rm -rf "${SNAPCRAFT_PART_BUILD}/code/ tools"
76-
77- snapcraftctl build
90+ tools/rebuild-node-modules.sh $NW_VERSION
91+ rm -rf tools
92+ cp -r package.nw $SNAPCRAFT_PART_INSTALL
93+ chmod -R 755 $SNAPCRAFT_PART_INSTALL/package.nw
7894
7995 stage-packages :
8096 - libxkbfile1
8197 - git-core
82- override-prime : |
83- snapcraftctl prime
84- rm -rf node node.exe
85- cp "$SNAPCRAFT_PRIME/nodejs/bin/node" "$SNAPCRAFT_PRIME/node"
86- ln -s "node" "node.exe"
98+ - libssh2-1-dev
8799
88100 after :
89101 - node-js
90- # - compiler
102+ - package-nw
91103 # - desktop-gnome-platform
92104
93105 nw-js :
94106 plugin : dump
95107 source : https://npmmirror.com/mirrors/nwjs/v0.55.0/nwjs-sdk-v0.55.0-linux-x64.tar.gz
96108 # source: ./cache/nwjs-sdk-v0.55.0-linux-x64.tar.gz
109+ organize :
110+ " * " : nwjs/
97111 stage-packages :
98112 - libnss3
99113 - libnspr4
114+ override-pull : |
115+ ls -l
116+ ls -l $SNAPCRAFT_PART_SRC
117+ ls -l $SNAPCRAFT_PART_BUILD
118+ snapcraftctl pull
119+ ls -l
120+ ls -l $SNAPCRAFT_PART_SRC
121+ ls -l $SNAPCRAFT_PART_BUILD
122+ rm -rf nacl_irt_x86_64.nexe
123+ # chmod 644 nacl_irt_x86_64.nexe
124+ # tar -zcf nacl_irt_x86_64.nexe.tar.gz nacl_irt_x86_64.nexe
125+ # ln -s $SNAP/nacl_irt_x86_64.nexe nacl_irt_x86_64.nexe
126+ ls -l
127+ ls -l $SNAPCRAFT_PART_SRC
128+ ls -l $SNAPCRAFT_PART_BUILD
129+ ls -l $SNAPCRAFT_PART_INSTALL
130+ ls -l $SNAPCRAFT_STAGE
131+
132+ override-build : |
133+ ls -l
134+ rm -rf $SNAPCRAFT_PART_INSTALL/nwjs/node $SNAPCRAFT_PART_INSTALL/nwjs/node.exe
135+ install -Dm755 $SNAPCRAFT_STAGE/node/bin/node $SNAPCRAFT_PART_INSTALL/nwjs/node
136+ cd $SNAPCRAFT_PART_INSTALL/nwjs && ln -s node node.exe
137+ ls -l $SNAPCRAFT_PART_INSTALL/nwjs
138+ snapcraftctl build
139+ ls -l $SNAPCRAFT_PART_INSTALL/nwjs
140+ after :
141+ - build-node
100142
101143 run-script :
102144 plugin : nil
103145 override-build : |
104146 snapcraftctl build
105- cp "${SNAPCRAFT_PROJECT_DIR}/bin/wechat-devtools-snap" "$SNAPCRAFT_PART_INSTALL/wechat-devtools-snap"
147+ ls
148+ install -Dm755 "${SNAPCRAFT_PROJECT_DIR}/bin/wechat-devtools" "$SNAPCRAFT_PART_INSTALL/bin/wechat-devtools"
149+ install -Dm755 "${SNAPCRAFT_PROJECT_DIR}/bin/wechat-devtools-cli" "$SNAPCRAFT_PART_INSTALL/bin/wechat-devtools-cli"
150+
106151 stage :
107- - wechat-devtools-snap
108-
109- zzz :
110- plugin : nil
111- # source: https://npmmirror.com/mirrors/nwjs/v0.53.1/nwjs-sdk-v0.53.1-linux-x64.tar.gz
112- override-stage : |
113- echo "6"
114- env
115- ls -l $SNAPCRAFT_STAGE
152+ - bin/wechat-devtools
153+ - bin/wechat-devtools-cli
154+ - usr/*
116155
117156apps :
118157 wechat-devtools :
119158 # autostart: wechat-devtools.desktop
120- command : desktop-launch $SNAP /wechat-devtools-snap
159+ command : bin /wechat-devtools
121160 environment :
122161 WECHAT_DEVTOOLS_DIR : $SNAP/nwjs
123162 APPDATA : " $SNAP_USER_DATA/wechat_devtools"
@@ -132,13 +171,18 @@ apps:
132171 - desktop-legacy
133172 - opengl
134173 - mount-observe
174+ - adb-support
135175 - x11
136176 - wayland
137177 - network
138178 - network-bind
139179 - gsettings
140180 - browser-support
141- - password-manager-service
181+ - home
182+ - system-observe
183+ - removable-media
184+ - udisks2
185+ - unity7
142186
143187plugs :
144188 gtk-3-themes :
@@ -153,7 +197,3 @@ plugs:
153197 interface : content
154198 target : $SNAP/data-dir/sounds
155199 default-provider : gtk-common-themes
156- # platform_snap:
157- # interface: content
158- # target: $SNAP/gnome-platform
159- # default-provider: gnome-3-34-1804
0 commit comments