diff --git a/editors/picpas/Makefile b/editors/picpas/Makefile index f4bf77a90b46..331cc39714f3 100644 --- a/editors/picpas/Makefile +++ b/editors/picpas/Makefile @@ -1,51 +1,50 @@ PORTNAME= picpas PORTVERSION= 0.9.0 -PORTREVISION= 2 +PORTREVISION= 3 DISTVERSIONPREFIX= v CATEGORIES= editors PKGNAMESUFFIX= ${LAZARUS_PKGNAMESUFFIX} MAINTAINER= acm@FreeBSD.org COMMENT= Multi-platform Pascal for Microchip PIC16F microcontrollers LICENSE= GPLv2 -BROKEN= fails to build - gtk2_CONFLICTS_INSTALL= ${PORTNAME}-qt5 qt5_CONFLICTS_INSTALL= ${PORTNAME}-gtk2 USES= dos2unix fpc gnome lazarus:flavors xorg USE_FPC= chm fcl-base fcl-image fcl-json fcl-registry fcl-xml pasjpeg regexpr \ rtl-objpas x11 USE_XORG= x11 DOS2UNIX_REGEX= .*\.([txt]|pas|lpi|txt|lfm) USE_GITHUB= yes GH_ACCOUNT= t-edson GH_PROJECT= PicPas -GH_TAGNAME= 520e196 +GH_TAGNAME= 7940bc3 GH_TUPLE= t-edson:MiConfig:a4a988a:miconfig/miconfig \ t-edson:MisUtils:742eff3:misutils/misutils \ t-edson:PicUtils:5f89bdf:picutils/picutils \ - t-edson:SynFacilUtils:2909899:syncfacilutils/syncfacilutils \ + t-edson:SynFacilUtils:8725237:syncfacilutils/syncfacilutils \ t-edson:UtilsGrilla:07744b9:utilsgrilla/utilsgrilla \ t-edson:ogEditGraf:a19b68a:ogeditgraf/ogeeditgraf \ t-edson:t-Xpres:6665922:txpres/txpres USE_FPC_gtk2= cairo USE_GNOME_gtk2= cairo USE_FPC+= ${USE_FPC_${FLAVOR}} USE_GNOME+= ${USE_GNOME_${FLAVOR}} LAZARUS_PROJECT_FILES= Source/PicPas.lpi LAZBUILD_ARGS= -d post-patch: ${REINPLACE_CMD} 's|%%DATADIR%%|${DATADIR}|g' ${WRKSRC}/Source/Globales.pas + ${REINPLACE_CMD} 's|0.8.7|${PORTVERSION}|g' ${WRKSRC}/version.txt do-install: ${INSTALL_PROGRAM} ${WRKSRC}/PicPas-freebsd ${STAGEDIR}${PREFIX}/bin/${PORTNAME} @${MKDIR} ${STAGEDIR}${DATADIR} cd ${WRKSRC} && ${COPYTREE_SHARE} "devices10 devices16 devices17 syntax samples temp themes units" ${STAGEDIR}${DATADIR} .include diff --git a/editors/picpas/distinfo b/editors/picpas/distinfo index cff08542437d..31469355c90d 100644 --- a/editors/picpas/distinfo +++ b/editors/picpas/distinfo @@ -1,17 +1,17 @@ -TIMESTAMP = 1589399120 -SHA256 (t-edson-PicPas-v0.9.0-520e196_GH0.tar.gz) = 0c47225abbb99f397435571b8f57757f43e5a96c3b4ab3db14dd3339f78f43fd -SIZE (t-edson-PicPas-v0.9.0-520e196_GH0.tar.gz) = 19051230 +TIMESTAMP = 1627797955 +SHA256 (t-edson-PicPas-v0.9.0-7940bc3_GH0.tar.gz) = 33e149399c7bcb64a3f410d368e9cab610d5411df20035a768713df72f8d8542 +SIZE (t-edson-PicPas-v0.9.0-7940bc3_GH0.tar.gz) = 23122693 SHA256 (t-edson-MiConfig-a4a988a_GH0.tar.gz) = de54af664dc96f510393309454fe033e822ffae9f79ed56c715691713edaa65d SIZE (t-edson-MiConfig-a4a988a_GH0.tar.gz) = 34117 SHA256 (t-edson-MisUtils-742eff3_GH0.tar.gz) = 9b45ca7f6e3870f21abef8f670a54cd111b2cafae3149263399302cdccf973da SIZE (t-edson-MisUtils-742eff3_GH0.tar.gz) = 272412 SHA256 (t-edson-PicUtils-5f89bdf_GH0.tar.gz) = 28abdab6c5b553012cf9d474208e6e9c8d84c0499e48bb49305026bd506616d8 SIZE (t-edson-PicUtils-5f89bdf_GH0.tar.gz) = 328197 -SHA256 (t-edson-SynFacilUtils-2909899_GH0.tar.gz) = 8bf153428dbfddfd63e023175551f35bee464337cd5d10f5132534bf0c9181dc -SIZE (t-edson-SynFacilUtils-2909899_GH0.tar.gz) = 259715 +SHA256 (t-edson-SynFacilUtils-8725237_GH0.tar.gz) = 3b8fb86ef403557df6dc7287db0251ed169d2b5caeacc3b70bed9f2eefd1881b +SIZE (t-edson-SynFacilUtils-8725237_GH0.tar.gz) = 264089 SHA256 (t-edson-UtilsGrilla-07744b9_GH0.tar.gz) = 7f5ec2e53a9a58a296fa5d08eebbfe54e4040bf15952ff4720ae8e92d4fd3933 SIZE (t-edson-UtilsGrilla-07744b9_GH0.tar.gz) = 49776 SHA256 (t-edson-ogEditGraf-a19b68a_GH0.tar.gz) = 99ca2c8c76034983fb90349db2dd73a4fee2a3b7a8ec348bd151ebc18f4ef571 SIZE (t-edson-ogEditGraf-a19b68a_GH0.tar.gz) = 434318 SHA256 (t-edson-t-Xpres-6665922_GH0.tar.gz) = 813c2f966b3e0a7b1fb11010877b3a22a9f4de402bf90695f0aa056e6c69b0fe SIZE (t-edson-t-Xpres-6665922_GH0.tar.gz) = 833095 diff --git a/editors/picpas/files/patch-Source_FrameEditView.pas b/editors/picpas/files/patch-Source_FrameEditView.pas new file mode 100644 index 000000000000..f804a4439f9a --- /dev/null +++ b/editors/picpas/files/patch-Source_FrameEditView.pas @@ -0,0 +1,20 @@ +--- Source/FrameEditView.pas.orig 2021-08-01 06:56:07 UTC ++++ Source/FrameEditView.pas +@@ -438,9 +438,6 @@ begin + ed.OnCommandProcessed:=@edCommandProcessed; //necesita para actualizar el cursor + // RecentFiles := TStringList.Create; + MaxRecents := 1; //Inicia con 1 +- //guarda parámetros +- nomDef := nomDef0; +- extDef := extDef0; + NewFile; //Inicia editor con archivo vacío + /////////////////////////////////////////////////////////////// + tabWidth := 30; //valor por defecto +@@ -848,7 +845,6 @@ begin + ed.OnChangeEditorState := @ChangeEditorState; + ed.OnChangeFileInform := @editChangeFileInform; + ed.hl.IconList := ImgCompletion; +- ed.SetLanguage(curLanguage); + //Configura PageControl + ed.SynEdit.Parent := self; + ed.SynEdit.Align := alClient; diff --git a/editors/picpas/files/patch-Source_FramePICDiagram.pas b/editors/picpas/files/patch-Source_FramePICDiagram.pas index 6a0bf7519df9..b7b9410fbff2 100644 --- a/editors/picpas/files/patch-Source_FramePICDiagram.pas +++ b/editors/picpas/files/patch-Source_FramePICDiagram.pas @@ -1,84 +1,150 @@ ---- Source/FramePICDiagram.pas 2020-05-13 15:24:28.472849000 -0500 -+++ Source/FramePICDiagram.pas 2020-05-13 15:21:41.106017000 -0500 -@@ -1135,7 +1135,7 @@ +--- Source/FramePICDiagram.pas.orig 2021-08-01 06:56:07 UTC ++++ Source/FramePICDiagram.pas +@@ -573,13 +573,13 @@ begin + //Cuerpo + col := GetThevCol(nodParent.vt, nodParent.rt); //Se supone que el nodo padre ya está actualizado + v2d.SetPen(psSolid, 1, col); +- v2d.Linea(pcBEGIN.x, pcBEGIN.y, pcEND.x, pcEND.y); ++ v2d.Line(pcBEGIN.x, pcBEGIN.y, pcEND.x, pcEND.y); + //Implementamos nosotros el remarcado y selección, para personalizar mejor + //---------------Draw mark -------------- + if Marked and Highlight then begin + //Resaltado + v2d.SetPen(psSolid, 2, clBlue); //RGB(128, 128, 255) +- v2d.Linea(pcBEGIN.x, pcBEGIN.y, pcEND.x, pcEND.y); ++ v2d.Line(pcBEGIN.x, pcBEGIN.y, pcEND.x, pcEND.y); + //Marcador de Voltaje + v2d.SetPen(psSolid, 1, clBlack); //RGB(128, 128, 255) + v2d.SetBrush(clYellow); +@@ -824,8 +824,8 @@ begin + //Dibuja cuerpo + v2d.SetPen(psSolid, 2, COL_GND); + //Línea vertioal y conexión a tierra +- v2d.Linea(x+12, y, x+12, y2); +- v2d.Linea(x+5, y2, x+19, y2); ++ v2d.Line(x+12, y, x+12, y2); ++ v2d.Line(x+5, y2, x+19, y2); + //Resistencia + v2d.SetPen(psSolid, 1, COL_GND); + v2d.SetBrush(COL_RES); +@@ -932,15 +932,15 @@ begin + //conexión a tierra + v2d.SetPen(psSolid, 1, COL_GND); + y2 := y + height + 10; +- v2d.Linea(x+30, y+height, x+30, y2); +- v2d.Linea(x+24, y2, x+36, y2); ++ v2d.Line(x+30, y+height, x+30, y2); ++ v2d.Line(x+24, y2, x+36, y2); + //Dibuja los pines + v2d.SetPen(psSolid, 1, COL_GND); + for pCnx in PtosConex do begin + pin := TPinGraph(pCnx); + //En el PIC, los pines se pintan con el color del modelo interno + v2d.SetBrush(clWhite); //Rellena de acuerdo al estado +- v2d.Linea(pin.x, pin.y, pin.x+7, pin.y); ++ v2d.Line(pin.x, pin.y, pin.x+7, pin.y); + v2d.Texto(x+pin.xLbl, y+pin.yLbl, pin.lbl); + end; + inherited; +@@ -999,8 +999,8 @@ begin + + //Línea vertioal y conexión a tierra + v2d.SetPen(psSolid, 2, COL_GND); +- v2d.Linea(x+12, y, x+12, y2); +- v2d.Linea(x+5, y2, x+19, y2); ++ v2d.Line(x+12, y, x+12, y2); ++ v2d.Line(x+5, y2, x+19, y2); + //Resistencia + v2d.SetPen(psSolid, 1, COL_GND); + v2d.SetBrush(COL_RES); +@@ -1044,7 +1044,7 @@ begin + nod.UpdateModel; + end; + end; //Protección +- motEdi.Refrescar; ++ motEdi.Refresh; + end; + procedure TfraPICDiagram.SetCompiler(cxp0: TCompilerBase); + begin +@@ -1135,7 +1135,7 @@ var begin nodeList.Clear; //Explora objetos gráfiocs - for og in motEdi.objetos do begin + for og in motEdi.objects do begin if og is TOgConector then begin ogCon := TOgConector(og); AddConnectorToNodes(ogCon); -@@ -1151,7 +1151,7 @@ +@@ -1151,7 +1151,7 @@ function TfraPICDiagram.ExistsName(AName: string): boo var og: TObjGraf; begin - for og in motEdi.objetos do begin + for og in motEdi.objects do begin if og.Name = AName then exit(true); end; exit(false); -@@ -1174,7 +1174,7 @@ +@@ -1174,7 +1174,7 @@ function TfraPICDiagram.ExistsRef(ARef: string): TOgCo var og: TObjGraf; begin - for og in motEdi.objetos do begin + for og in motEdi.objects do begin if not(og is TOgComponent) then continue; if TOgComponent(og).Ref = ARef then exit(TOgComponent(og)); end; -@@ -1201,7 +1201,7 @@ +@@ -1201,7 +1201,7 @@ var //oc: TOgConector; //xv, yv: Single; begin - if motEdi.seleccion.Count = 1 then begin + if motEdi.selection.Count = 1 then begin //Hay uno seleccionado if motEdi.Selected.IsSelectedBy(X,Y) then begin //Click sobre un objeto seleccionado -@@ -1240,7 +1240,7 @@ +@@ -1240,7 +1240,7 @@ procedure TfraPICDiagram.motEdi_MouseUp(Sender: TObjec var LogInp: TOgLogicState; begin - if motEdi.seleccion.Count = 1 then begin + if motEdi.selection.Count = 1 then begin //Hay un componente seleccionado if motEdi.Selected.IsSelectedBy(X,Y) then begin if motEdi.Selected is TOgLogicState then begin -@@ -1267,15 +1267,15 @@ +@@ -1267,15 +1267,15 @@ var pCnx, pCnx2: TPtoConx; begin //Verifica el estado para activar acciones - acGenDelObject.Visible := motEdi.seleccion.Count>0; - if motEdi.seleccion.Count = 0 then begin + acGenDelObject.Visible := motEdi.selection.Count>0; + if motEdi.selection.Count = 0 then begin //Ninguno seleccionado mnReset.Visible := true; mnRun.Visible := true; mnStepOver.Visible:= false; //mnAddLogicTog.Visible := true; VisibActionsAdd(true); - end else if (motEdi.seleccion.Count = 1) and (motEdi.Selected is TOgComponent) then begin + end else if (motEdi.selection.Count = 1) and (motEdi.Selected is TOgComponent) then begin //Hay un componente seleccionado comp1 := TOgComponent(motEdi.Selected); //Componente fuente mnReset.Visible := true; -@@ -1308,7 +1308,7 @@ +@@ -1308,7 +1308,7 @@ begin mnConnect.Caption := Format('Connect %s to', [pin1.lbl]); //Actualiza menú de Conexión, con objetos gráficos mnConnect.Clear; - for og in motEdi.objetos do begin + for og in motEdi.objects do begin if not(og is TOgComponent) then continue; if og is TOgConector then continue;; it := AddItemToMenu(mnConnect, og.Name, nil); -@@ -1454,7 +1454,7 @@ +@@ -1454,7 +1454,7 @@ var begin nodeList.Clear; //Explora objetos gráfiocs - for og in motEdi.objetos do begin + for og in motEdi.objects do begin if og is TOgConector then begin ogCon := TOgConector(og); if ogCon.pcBEGIN.ConnectedTo = nil then begin diff --git a/editors/picpas/files/patch-Source_Globales.pas b/editors/picpas/files/patch-Source_Globales.pas index 2a88cbe51570..a896b112562a 100644 --- a/editors/picpas/files/patch-Source_Globales.pas +++ b/editors/picpas/files/patch-Source_Globales.pas @@ -1,149 +1,149 @@ ---- Source/Globales.pas 2018-08-10 01:10:52.847492000 -0500 -+++ Source/Globales.pas 2018-08-10 01:19:30.813221000 -0500 -@@ -5,7 +5,7 @@ +--- Source/Globales.pas.orig 2021-08-01 06:56:07 UTC ++++ Source/Globales.pas +@@ -5,7 +5,7 @@ unit Globales; {$mode objfpc}{$H+} interface uses Classes, SysUtils, Forms, SynEdit, SynEditKeyCmds, MisUtils, - lclType, FileUtil, LazLogger, Menus ; + lclType, FileUtil, LazLogger, Menus,Process, LazFileUtils, LazUTF8 ; const NOM_PROG = 'PicPas'; //nombre de programa -@@ -29,6 +29,7 @@ +@@ -29,6 +29,7 @@ var archivoEnt : string; //archivo de entrada MostrarError: Boolean; //Bandera para mostrar mensajesde error. ActConsSeg : Boolean; //Activa consultas en segundo plano + S: string; /////////////// Campos para manejo del diccionario ////////// var -@@ -176,7 +177,11 @@ +@@ -176,7 +177,11 @@ End; initialization //inicia directorios de la aplicación - patApp := ExtractFilePath(Application.ExeName); //incluye el '\' final + {$ifdef windows} + patApp := GetEnvironmentVariableUTF8('appdata')+'\PicPas\'; + {$else} + patApp := GetEnvironmentVariableUTF8('HOME')+'/.config/PicPas/'; + {$endif} patSamples := patApp + 'samples'; patUnits := patApp + 'units'; patTemp := patApp + 'temp'; -@@ -189,41 +194,107 @@ +@@ -189,41 +194,107 @@ initialization archivoEnt := ''; //archivo de entrada //verifica existencia de carpetas de trabajo try + if not DirectoryExists(patApp) then begin + CreateDir(patApp); + end; if not DirectoryExists(patSamples) then begin msgexc(WA_DIR_NOEXIST, [patSamples]); - CreateDir(patSamples); + {$ifdef freebsd} + RunCommand('cp', ['-R', -+ '%%DATADIR%%/samples', ++ '/usr/local/share/picpas/samples', + patSamples + ], S); + {else} + CreateDir(patSamples); + {$endif} end; if not DirectoryExists(patUnits) then begin msgexc(WA_DIR_NOEXIST, [patUnits]); - CreateDir(patUnits); + {$ifdef freebsd} + RunCommand('cp', ['-R', -+ '%%DATADIR%%/units', ++ '/usr/local/share/picpas/units', + patUnits + ], S); + {else} + CreateDir(patUnits); + {$endif} end; if not DirectoryExists(patDevices10) then begin msgexc(WA_DIR_NOEXIST, [patDevices10]); - CreateDir(patDevices10); + {$ifdef freebsd} + RunCommand('cp', ['-R', -+ '%%DATADIR%%/devices10', ++ '/usr/local/share/picpas/devices10', + patDevices10 + ], S); + {else} + CreateDir(patDevices10); + {$endif} end; if not DirectoryExists(patDevices16) then begin msgexc(WA_DIR_NOEXIST, [patDevices16]); - CreateDir(patDevices16); + {$ifdef freebsd} + RunCommand('cp', ['-R', -+ '%%DATADIR%%/devices16', ++ '/usr/local/share/picpas/devices16', + patDevices16 + ], S); + {else} + CreateDir(patDevices16); + {$endif} end; if not DirectoryExists(patDevices17) then begin msgexc(WA_DIR_NOEXIST, [patDevices17]); - CreateDir(patDevices17); + {$ifdef freebsd} + RunCommand('cp', ['-R', -+ '%%DATADIR%%/devices17', ++ '/usr/local/share/picpas/devices17', + patDevices17 + ], S); + {else} + CreateDir(patDevices17); + {$endif} end; if not DirectoryExists(patDevices18) then begin msgexc(WA_DIR_NOEXIST, [patDevices18]); - CreateDir(patDevices18); + {$ifdef freebsd} + RunCommand('cp', ['-R', -+ '%%DATADIR%%/devices18', ++ '/usr/local/share/picpas/devices18', + patDevices18 + ], S); + {else} + CreateDir(patDevices18); + {$endif} end; if not DirectoryExists(patTemp) then begin msgexc(WA_DIR_NOEXIST, [patTemp]); - CreateDir(patTemp); + {$ifdef freebsd} + RunCommand('cp', ['-R', -+ '%%DATADIR%%/temp', ++ '/usr/local/share/picpas/temp', + patTemp + ], S); + {else} + CreateDir(patTemp); + {$endif} end; if not DirectoryExists(patSyntax) then begin msgexc(WA_DIR_NOEXIST, [patSyntax]); - CreateDir(patSyntax); + {$ifdef freebsd} + RunCommand('cp', ['-R', -+ '%%DATADIR%%/syntax', ++ '/usr/local/share/picpas/syntax', + patSyntax + ], S); + {else} + CreateDir(patSyntax); + {$endif} end; if not DirectoryExists(patThemes) then begin msgexc(WA_DIR_NOEXIST, [patThemes]); - CreateDir(patThemes); + {$ifdef freebsd} + RunCommand('cp', ['-R', -+ '%%DATADIR%%/themes', ++ '/usr/local/share/picpas/themes', + patThemes + ], S); + {else} + CreateDir(patThemes); + {$endif} end; except diff --git a/editors/picpas/files/patch-Source_PicPas.lpi b/editors/picpas/files/patch-Source_PicPas.lpi index 64eef8c2ba41..5a84ea3f2f04 100644 --- a/editors/picpas/files/patch-Source_PicPas.lpi +++ b/editors/picpas/files/patch-Source_PicPas.lpi @@ -1,20 +1,20 @@ ---- Source/PicPas.lpi 2020-05-13 13:51:01.804862000 -0500 -+++ Source/PicPas.lpi 2020-05-13 14:38:14.698077000 -0500 +--- Source/PicPas.lpi.orig 2021-08-01 06:56:07 UTC ++++ Source/PicPas.lpi @@ -25,7 +25,7 @@ -- +- + -@@ -309,7 +309,7 @@ +@@ -301,7 +301,7 @@ -- +- + diff --git a/editors/picpas/files/patch-miconfig_MiConfigXML.pas b/editors/picpas/files/patch-miconfig_MiConfigXML.pas index a3d261d04ba1..3985a6d51a71 100644 --- a/editors/picpas/files/patch-miconfig_MiConfigXML.pas +++ b/editors/picpas/files/patch-miconfig_MiConfigXML.pas @@ -1,20 +1,20 @@ ---- miconfig/MiConfigXML.pas 2018-04-26 21:42:01.343702000 -0500 -+++ miconfig/MiConfigXML.pas 2018-04-26 21:43:20.791884000 -0500 -@@ -20,7 +20,7 @@ +--- miconfig/MiConfigXML.pas.orig 2021-08-01 06:56:07 UTC ++++ miconfig/MiConfigXML.pas +@@ -20,7 +20,7 @@ unit MiConfigXML; {$mode objfpc}{$H+} interface uses - Classes, SysUtils, Graphics, Forms, Laz2_XMLCfg, MisUtils, MiConfigBasic; + Classes, SysUtils, Graphics, Forms, Laz2_XMLCfg, MisUtils, MiConfigBasic, LazFileUtils, LazUTF8; type { TMiConfigXML } {Clase base que es usada para manejar los campos de configuración.} -@@ -75,7 +75,7 @@ +@@ -75,7 +75,7 @@ end; function TMiConfigXML.DefaultFileName: string; {Devuelve el nombre por defecto del archvio de configuración} begin - Result := ChangeFileExt(Application.ExeName,'.xml'); + Result := ChangeFileExt(GetEnvironmentVariableUTF8('HOME')+'/.config/PicPas/'+Application.ExeName,'.xml'); end; procedure TMiConfigXML.VerifyFile; //Verifica si el archivo XML "FileName" existe. Si no, muestra un mensaje y lo crea.